home *** CD-ROM | disk | FTP | other *** search
MacBinary | 1994-02-23 | 29.8 KB | [TEXT/KAHL] |
open in:
MacOS 8.1
|
Win98
|
DOS
view JSON data
|
view as text
This file was processed as: MacBinary
(archive/macBinary).
You can browse this item here: TransDisplay.c
Confidence | Program | Detection | Match Type | Support
|
---|
66%
| dexvert
| Compact Compressed (Unix) (archive/compact)
| ext
| Supported |
10%
| dexvert
| MacBinary (archive/macBinary)
| fallback
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| MacBinary II, inited, Wed Feb 23 03:36:05 1994, modified Wed Feb 23 03:36:05 1994, creator Think C, type ASCII, 28685 bytes "TransDisplay.c" , at 0x708d 1530 bytes resource
| default (weak)
| |
99%
| file
| data
| default
| |
74%
| TrID
| Macintosh plain text (MacBinary)
| default
| |
25%
| TrID
| MacBinary 2
| default (weak)
| |
100%
| siegfried
| fmt/1762 MacBinary (II)
| default
| |
100%
| lsar
| MacBinary
| default
|
|
id metadata |
---|
key | value |
---|
macFileType | [TEXT] |
macFileCreator | [KAHL] |
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0e 54 72 61 6e 73 44 | 69 73 70 6c 61 79 2e 63 |..TransD|isplay.c|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4b 41 48 | 4c 01 00 00 00 00 00 00 |.TEXTKAH|L.......|
|00000050| 00 00 00 00 00 70 0d 00 | 00 05 fa a9 90 c5 f5 a9 |.....p..|........|
|00000060| 90 c5 f5 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 03 51 00 00 |........|.....Q..|
|00000080| 2f 2a 0d 20 2a 20 55 73 | 65 20 53 65 74 53 63 72 |/*. * Us|e SetScr|
|00000090| 6f 6c 6c 56 61 6c 75 65 | 28 29 20 69 6e 20 70 72 |ollValue|() in pr|
|000000a0| 65 66 65 72 65 6e 63 65 | 20 74 6f 20 53 65 74 43 |eference| to SetC|
|000000b0| 74 6c 56 61 6c 75 65 28 | 29 20 77 68 65 6e 20 73 |tlValue(|) when s|
|000000c0| 65 74 74 69 6e 67 20 73 | 63 72 6f 6c 6c 0d 20 2a |etting s|croll. *|
|000000d0| 2f 0d 0d 2f 2a 0d 20 2a | 20 54 72 61 6e 73 44 69 |/../*. *| TransDi|
|000000e0| 73 70 6c 61 79 20 76 65 | 72 73 69 6f 6e 20 33 2e |splay ve|rsion 3.|
|000000f0| 30 35 20 2d 20 54 72 61 | 6e 73 53 6b 65 6c 20 70 |05 - Tra|nsSkel p|
|00000100| 6c 75 67 2d 69 6e 20 6d | 6f 64 75 6c 65 20 73 75 |lug-in m|odule su|
|00000110| 70 70 6f 72 74 69 6e 67 | 0d 20 2a 20 61 6e 20 61 |pporting|. * an a|
|00000120| 72 62 69 74 72 61 72 79 | 20 6e 75 6d 62 65 72 20 |rbitrary| number |
|00000130| 6f 66 20 67 65 6e 65 72 | 69 63 20 64 69 73 70 6c |of gener|ic displ|
|00000140| 61 79 20 77 69 6e 64 6f | 77 73 20 77 69 74 68 20 |ay windo|ws with |
|00000150| 6d 65 6d 6f 72 79 2e 0d | 20 2a 0d 20 2a 20 54 72 |memory..| *. * Tr|
|00000160| 61 6e 73 53 6b 65 6c 20 | 61 6e 64 20 54 72 61 6e |ansSkel |and Tran|
|00000170| 73 44 69 73 70 6c 61 79 | 20 61 72 65 20 70 75 62 |sDisplay| are pub|
|00000180| 6c 69 63 20 64 6f 6d 61 | 69 6e 2e 20 20 46 6f 72 |lic doma|in. For|
|00000190| 20 6d 6f 72 65 20 69 6e | 66 6f 72 6d 61 74 69 6f | more in|formatio|
|000001a0| 6e 2c 0d 20 2a 20 63 6f | 6e 74 61 63 74 3a 0d 20 |n,. * co|ntact:. |
|000001b0| 2a 0d 20 2a 20 09 09 09 | 50 61 75 6c 20 44 75 42 |*. * ...|Paul DuB|
|000001c0| 6f 69 73 0d 20 2a 20 09 | 09 09 57 69 73 63 6f 6e |ois. * .|..Wiscon|
|000001d0| 73 69 6e 20 52 65 67 69 | 6f 6e 61 6c 20 50 72 69 |sin Regi|onal Pri|
|000001e0| 6d 61 74 65 20 52 65 73 | 65 61 72 63 68 20 43 65 |mate Res|earch Ce|
|000001f0| 6e 74 65 72 0d 20 2a 20 | 09 09 09 31 32 32 30 20 |nter. * |...1220 |
|00000200| 43 61 70 69 74 6f 6c 20 | 43 6f 75 72 74 0d 20 2a |Capitol |Court. *|
|00000210| 20 09 09 09 4d 61 64 69 | 73 6f 6e 2c 20 57 49 20 | ...Madi|son, WI |
|00000220| 20 35 33 37 31 35 2d 31 | 32 39 39 20 20 55 53 41 | 53715-1|299 USA|
|00000230| 0d 20 2a 0d 20 2a 20 49 | 6e 74 65 72 6e 65 74 3a |. *. * I|nternet:|
|00000240| 09 64 75 62 6f 69 73 40 | 70 72 69 6d 61 74 65 2e |.dubois@|primate.|
|00000250| 77 69 73 63 2e 65 64 75 | 0d 20 2a 0d 20 2a 0d 20 |wisc.edu|. *. *. |
|00000260| 2a 20 54 68 69 73 20 76 | 65 72 73 69 6f 6e 20 6f |* This v|ersion o|
|00000270| 66 20 54 72 61 6e 73 44 | 69 73 70 6c 61 79 20 69 |f TransD|isplay i|
|00000280| 73 20 77 72 69 74 74 65 | 6e 20 66 6f 72 20 54 48 |s writte|n for TH|
|00000290| 49 4e 4b 20 43 20 36 2e | 30 2e 0d 20 2a 20 54 48 |INK C 6.|0.. * TH|
|000002a0| 49 4e 4b 20 43 20 69 73 | 20 61 20 74 72 61 64 65 |INK C is| a trade|
|000002b0| 6d 61 72 6b 20 6f 66 3a | 0d 20 2a 0d 20 2a 20 09 |mark of:|. *. * .|
|000002c0| 09 09 53 79 6d 61 6e 74 | 65 63 20 43 6f 72 70 6f |..Symant|ec Corpo|
|000002d0| 72 61 74 69 6f 6e 0d 20 | 2a 20 09 09 09 31 30 32 |ration. |* ...102|
|000002e0| 30 31 20 54 6f 72 72 65 | 20 41 76 65 6e 75 65 0d |01 Torre| Avenue.|
|000002f0| 20 2a 20 09 09 09 43 75 | 70 65 72 74 69 6e 6f 2c | * ...Cu|pertino,|
|00000300| 20 43 41 20 39 35 30 31 | 34 20 20 55 53 41 0d 20 | CA 9501|4 USA. |
|00000310| 2a 0d 20 2a 20 48 69 73 | 74 6f 72 79 0d 20 2a 20 |*. * His|tory. * |
|00000320| 30 38 2f 32 35 2f 38 36 | 09 47 65 6e 65 73 69 73 |08/25/86|.Genesis|
|00000330| 2e 20 20 42 65 74 61 20 | 76 65 72 73 69 6f 6e 2e |. Beta |version.|
|00000340| 0d 20 2a 0d 20 2a 20 30 | 39 2f 31 35 2f 38 36 20 |. *. * 0|9/15/86 |
|00000350| 52 65 6c 65 61 73 65 20 | 31 2e 30 0d 20 2a 20 43 |Release |1.0. * C|
|00000360| 68 61 6e 67 65 64 20 74 | 6f 20 61 6c 6c 6f 77 20 |hanged t|o allow |
|00000370| 61 72 62 69 74 72 61 72 | 79 20 6e 75 6d 62 65 72 |arbitrar|y number|
|00000380| 20 6f 66 20 77 69 6e 64 | 6f 77 73 2e 0d 20 2a 0d | of wind|ows.. *.|
|00000390| 20 2a 20 30 31 2f 31 37 | 2f 38 37 09 52 65 6c 65 | * 01/17|/87.Rele|
|000003a0| 61 73 65 20 31 2e 30 31 | 0d 20 2a 20 54 68 65 20 |ase 1.01|. * The |
|000003b0| 77 69 6e 64 6f 77 20 74 | 79 70 65 20 77 68 65 6e |window t|ype when|
|000003c0| 20 61 20 6e 65 77 20 77 | 69 6e 64 6f 77 20 69 73 | a new w|indow is|
|000003d0| 20 63 72 65 61 74 65 64 | 20 77 69 74 68 20 4e 65 | created| with Ne|
|000003e0| 77 44 57 69 6e 64 6f 77 | 20 69 73 0d 20 2a 20 64 |wDWindow| is. * d|
|000003f0| 6f 63 75 6d 65 6e 74 50 | 72 6f 63 2b 38 20 6e 6f |ocumentP|roc+8 no|
|00000400| 77 2c 20 73 6f 20 74 68 | 61 74 20 74 68 65 20 77 |w, so th|at the w|
|00000410| 69 6e 64 6f 77 20 77 69 | 6c 6c 20 68 61 76 65 20 |indow wi|ll have |
|00000420| 61 20 7a 6f 6f 6d 20 62 | 6f 78 20 6f 6e 20 61 0d |a zoom b|ox on a.|
|00000430| 20 2a 20 6d 61 63 68 69 | 6e 65 20 77 69 74 68 20 | * machi|ne with |
|00000440| 31 32 38 4b 20 52 4f 4d | 53 2e 0d 20 2a 0d 20 2a |128K ROM|S.. *. *|
|00000450| 20 30 31 2f 32 39 2f 38 | 39 09 52 65 6c 65 61 73 | 01/29/8|9.Releas|
|00000460| 65 20 32 2e 30 0d 20 2a | 20 43 6f 6e 76 65 72 74 |e 2.0. *| Convert|
|00000470| 65 64 20 74 6f 20 77 6f | 72 6b 20 77 69 74 68 20 |ed to wo|rk with |
|00000480| 54 72 61 6e 73 53 6b 65 | 6c 20 32 2e 30 2e 20 20 |TransSke|l 2.0. |
|00000490| 44 69 73 70 6c 61 79 20 | 77 69 6e 64 6f 77 20 63 |Display |window c|
|000004a0| 72 65 61 74 69 6f 6e 20 | 72 6f 75 74 69 6e 65 73 |reation |routines|
|000004b0| 0d 20 2a 20 6e 6f 77 20 | 63 68 65 63 6b 20 77 68 |. * now |check wh|
|000004c0| 65 74 68 65 72 20 77 69 | 6e 64 6f 77 20 61 6e 64 |ether wi|ndow and|
|000004d0| 20 77 69 6e 64 6f 77 20 | 68 61 6e 64 6c 65 72 20 | window |handler |
|000004e0| 63 72 65 61 74 69 6f 6e | 20 73 75 63 63 65 65 64 |creation| succeed|
|000004f0| 65 64 20 61 6e 64 0d 20 | 2a 20 72 65 74 75 72 6e |ed and. |* return|
|00000500| 20 6e 69 6c 20 69 66 20 | 6e 6f 74 2e 20 20 32 2d | nil if |not. 2-|
|00000510| 62 79 74 65 20 61 6e 64 | 20 34 2d 62 79 74 65 20 |byte and| 4-byte |
|00000520| 69 6e 74 65 67 65 72 20 | 74 79 70 65 73 20 61 72 |integer |types ar|
|00000530| 65 20 74 79 70 65 64 65 | 66 27 65 64 20 74 6f 0d |e typede|f'ed to.|
|00000540| 20 2a 20 49 6e 74 65 67 | 65 72 20 61 6e 64 20 4c | * Integ|er and L|
|00000550| 6f 6e 67 49 6e 74 20 74 | 6f 20 65 61 73 65 20 70 |ongInt t|o ease p|
|00000560| 6f 72 74 69 6e 67 2e 0d | 20 2a 0d 20 2a 20 32 34 |orting..| *. * 24|
|00000570| 20 44 65 63 20 39 30 20 | 52 65 6c 65 61 73 65 20 | Dec 90 |Release |
|00000580| 33 2e 30 31 0d 20 2a 20 | 2d 20 53 74 61 72 74 65 |3.01. * |- Starte|
|00000590| 64 20 63 6f 6e 76 65 72 | 74 69 6e 67 20 74 6f 20 |d conver|ting to |
|000005a0| 77 6f 72 6b 20 77 69 74 | 68 20 54 72 61 6e 73 53 |work wit|h TransS|
|000005b0| 6b 65 6c 20 33 2e 0d 20 | 2a 20 2d 20 42 65 67 61 |kel 3.. |* - Bega|
|000005c0| 6e 20 61 64 64 69 6e 67 | 20 70 72 6f 74 6f 74 79 |n adding| prototy|
|000005d0| 70 65 73 2e 0d 20 2a 20 | 30 31 20 4a 61 6e 20 39 |pes.. * |01 Jan 9|
|000005e0| 31 0d 20 2a 20 2d 20 54 | 6f 6f 6b 20 6f 75 74 20 |1. * - T|ook out |
|000005f0| 74 68 65 20 4d 61 63 69 | 6e 74 6f 73 68 20 68 65 |the Maci|ntosh he|
|00000600| 61 64 65 72 20 66 69 6c | 65 20 23 69 6e 63 6c 75 |ader fil|e #inclu|
|00000610| 64 65 73 2e 20 20 3c 4d | 61 63 48 65 61 64 65 72 |des. <M|acHeader|
|00000620| 73 3e 20 69 73 20 61 73 | 73 75 6d 65 64 0d 20 2a |s> is as|sumed. *|
|00000630| 20 74 6f 20 62 65 20 74 | 75 72 6e 65 64 20 6f 6e | to be t|urned on|
|00000640| 20 73 6f 20 74 68 61 74 | 20 69 74 27 73 20 6e 6f | so that| it's no|
|00000650| 74 20 6e 65 63 65 73 73 | 61 72 79 2e 0d 20 2a 20 |t necess|ary.. * |
|00000660| 30 36 20 4a 75 6e 20 39 | 32 0d 20 2a 20 2d 20 46 |06 Jun 9|2. * - F|
|00000670| 69 78 65 64 20 47 65 74 | 44 57 69 6e 64 6f 77 54 |ixed Get|DWindowT|
|00000680| 45 28 29 20 62 75 67 2e | 20 20 57 61 73 20 72 65 |E() bug.| Was re|
|00000690| 74 75 72 6e 69 6e 67 20 | 6e 69 6c 20 75 6e 64 65 |turning |nil unde|
|000006a0| 72 20 6d 75 6c 74 69 77 | 69 6e 64 6f 77 0d 20 2a |r multiw|indow. *|
|000006b0| 20 63 6f 6d 70 69 6c 61 | 74 69 6f 6e 2e 0d 20 2a | compila|tion.. *|
|000006c0| 0d 20 2a 20 30 35 20 4a | 75 6e 20 39 33 20 52 65 |. * 05 J|un 93 Re|
|000006d0| 6c 65 61 73 65 20 33 2e | 30 32 0d 20 2a 20 2d 20 |lease 3.|02. * - |
|000006e0| 43 6f 6e 76 65 72 73 69 | 6f 6e 20 66 6f 72 20 54 |Conversi|on for T|
|000006f0| 48 49 4e 4b 20 43 20 36 | 2e 30 2e 0d 20 2a 0d 20 |HINK C 6|.0.. *. |
|00000700| 2a 20 30 37 20 4a 75 6e | 20 39 33 20 52 65 6c 65 |* 07 Jun| 93 Rele|
|00000710| 61 73 65 20 33 2e 30 33 | 0d 20 2a 20 2d 20 54 6f |ase 3.03|. * - To|
|00000720| 6f 6b 20 6f 75 74 20 61 | 6c 6c 20 74 68 65 20 73 |ok out a|ll the s|
|00000730| 74 75 66 66 20 74 6f 20 | 61 6c 6c 6f 77 20 63 6f |tuff to |allow co|
|00000740| 6d 70 69 6c 69 6e 67 20 | 74 6f 20 68 61 6e 64 6c |mpiling |to handl|
|00000750| 65 20 6f 6e 6c 79 20 61 | 20 73 69 6e 67 6c 65 0d |e only a| single.|
|00000760| 20 2a 20 64 69 73 70 6c | 61 79 20 77 69 6e 64 6f | * displ|ay windo|
|00000770| 77 2e 20 20 54 68 65 20 | 73 61 76 69 6e 67 73 20 |w. The |savings |
|00000780| 69 6e 20 62 79 74 65 73 | 20 6f 66 20 6f 62 6a 65 |in bytes| of obje|
|00000790| 63 74 20 63 6f 64 65 20 | 69 73 20 6e 6f 20 6c 6f |ct code |is no lo|
|000007a0| 6e 67 65 72 20 77 6f 72 | 74 68 0d 20 2a 20 74 68 |nger wor|th. * th|
|000007b0| 65 20 65 78 74 72 61 20 | 73 6f 75 72 63 65 20 63 |e extra |source c|
|000007c0| 6f 64 65 20 63 6f 6d 70 | 6c 65 78 69 74 79 2e 20 |ode comp|lexity. |
|000007d0| 20 49 74 27 73 20 61 6c | 73 6f 20 75 6e 6e 65 63 | It's al|so unnec|
|000007e0| 65 73 73 61 72 79 20 62 | 65 63 61 75 73 65 20 49 |essary b|ecause I|
|000007f0| 20 6e 6f 20 6c 6f 6e 67 | 65 72 0d 20 2a 20 6d 61 | no long|er. * ma|
|00000800| 69 6e 74 61 69 6e 20 61 | 20 77 69 6e 64 6f 77 20 |intain a| window |
|00000810| 6c 69 73 74 2c 20 73 69 | 6e 63 65 20 49 20 2e 2e |list, si|nce I ..|
|00000820| 2e 0d 20 2a 20 2d 20 52 | 65 69 6d 70 6c 65 6d 65 |.. * - R|eimpleme|
|00000830| 6e 74 65 64 20 6c 69 6e | 6b 65 64 20 6c 69 73 74 |nted lin|ked list|
|00000840| 20 68 6f 6c 64 69 6e 67 | 20 64 69 73 70 6c 61 79 | holding| display|
|00000850| 20 77 69 6e 64 6f 77 20 | 64 61 74 61 20 75 73 69 | window |data usi|
|00000860| 6e 67 20 54 72 61 6e 73 | 53 6b 65 6c 27 73 0d 20 |ng Trans|Skel's. |
|00000870| 2a 20 77 69 6e 64 6f 77 | 20 70 72 6f 70 65 72 74 |* window| propert|
|00000880| 79 20 66 75 6e 63 74 69 | 6f 6e 73 20 28 6e 65 77 |y functi|ons (new|
|00000890| 20 69 6e 20 54 53 20 33 | 2e 30 30 29 2e 20 20 54 | in TS 3|.00). T|
|000008a0| 68 65 20 70 72 6f 70 65 | 72 74 79 20 74 79 70 65 |he prope|rty type|
|000008b0| 20 69 73 0d 20 2a 20 73 | 6b 65 6c 57 50 72 6f 70 | is. * s|kelWProp|
|000008c0| 44 69 73 70 6c 61 79 57 | 69 6e 64 2c 20 61 6e 64 |DisplayW|ind, and|
|000008d0| 20 74 68 65 20 64 61 74 | 61 20 76 61 6c 75 65 20 | the dat|a value |
|000008e0| 69 73 20 61 20 68 61 6e | 64 6c 65 20 74 6f 20 74 |is a han|dle to t|
|000008f0| 68 65 20 77 69 6e 64 6f | 77 20 64 61 74 61 0d 20 |he windo|w data. |
|00000900| 2a 20 73 74 72 75 63 74 | 75 72 65 2e 0d 20 2a 20 |* struct|ure.. * |
|00000910| 2d 20 54 6f 6f 6b 20 6f | 75 74 20 61 6c 6c 20 74 |- Took o|ut all t|
|00000920| 68 65 20 22 72 65 67 69 | 73 74 65 72 22 20 64 65 |he "regi|ster" de|
|00000930| 63 6c 61 72 61 74 69 6f | 6e 73 2e 20 20 54 68 65 |claratio|ns. The|
|00000940| 20 63 6f 6d 70 69 6c 65 | 72 27 73 20 73 6d 61 72 | compile|r's smar|
|00000950| 74 20 65 6e 6f 75 67 68 | 0d 20 2a 20 6e 6f 77 20 |t enough|. * now |
|00000960| 74 68 61 74 20 74 68 65 | 79 20 64 6f 6e 27 74 20 |that the|y don't |
|00000970| 6d 61 6b 65 20 61 6e 79 | 20 64 69 66 66 65 72 65 |make any| differe|
|00000980| 6e 63 65 2c 20 73 6f 20 | 74 68 65 79 27 72 65 20 |nce, so |they're |
|00000990| 6a 75 73 74 20 63 6c 75 | 74 74 65 72 2e 0d 20 2a |just clu|tter.. *|
|000009a0| 20 30 35 20 4a 75 6c 20 | 39 33 0d 20 2a 20 2d 20 | 05 Jul |93. * - |
|000009b0| 46 69 78 65 64 20 41 63 | 74 69 76 61 74 65 28 29 |Fixed Ac|tivate()|
|000009c0| 20 61 6e 64 20 55 70 64 | 61 74 65 28 29 20 73 6f | and Upd|ate() so|
|000009d0| 20 74 68 61 74 20 77 68 | 65 6e 20 61 20 77 69 6e | that wh|en a win|
|000009e0| 64 6f 77 20 67 6f 65 73 | 20 69 6e 61 63 74 69 76 |dow goes| inactiv|
|000009f0| 65 2c 0d 20 2a 20 74 68 | 65 20 73 63 72 6f 6c 6c |e,. * th|e scroll|
|00000a00| 20 62 61 72 20 69 73 20 | 68 69 64 64 65 6e 20 28 | bar is |hidden (|
|00000a10| 61 6e 64 20 6f 6e 6c 79 | 20 74 68 65 20 66 72 61 |and only| the fra|
|00000a20| 6d 65 20 64 72 61 77 6e | 29 2e 20 20 50 72 65 76 |me drawn|). Prev|
|00000a30| 69 6f 75 73 6c 79 2c 20 | 74 68 65 0d 20 2a 20 73 |iously, |the. * s|
|00000a40| 63 72 6f 6c 6c 20 62 61 | 72 20 77 61 73 20 6a 75 |croll ba|r was ju|
|00000a50| 73 74 20 6d 61 64 65 20 | 69 6e 61 63 74 69 76 65 |st made |inactive|
|00000a60| 2c 20 77 68 69 63 68 20 | 64 6f 65 73 6e 27 74 20 |, which |doesn't |
|00000a70| 71 75 69 74 65 20 63 6f | 6e 66 6f 72 6d 20 74 6f |quite co|nform to|
|00000a80| 20 74 68 65 20 75 73 65 | 72 0d 20 2a 20 69 6e 74 | the use|r. * int|
|00000a90| 65 72 66 61 63 65 20 67 | 75 69 64 65 6c 69 6e 65 |erface g|uideline|
|00000aa0| 73 2e 0d 20 2a 20 31 37 | 20 4f 63 74 20 39 33 0d |s.. * 17| Oct 93.|
|00000ab0| 20 2a 20 2d 20 41 64 64 | 65 64 20 44 69 73 70 6c | * - Add|ed Displ|
|00000ac0| 61 79 4f 53 54 79 70 65 | 28 29 20 66 75 6e 63 74 |ayOSType|() funct|
|00000ad0| 69 6f 6e 2e 0d 20 2a 20 | 32 35 20 4e 6f 76 20 39 |ion.. * |25 Nov 9|
|00000ae0| 33 0d 20 2a 20 2d 20 54 | 65 73 74 73 20 74 6f 20 |3. * - T|ests to |
|00000af0| 63 68 65 63 6b 20 77 68 | 65 74 68 65 72 20 61 20 |check wh|ether a |
|00000b00| 77 69 6e 64 6f 77 20 69 | 73 20 74 68 65 20 61 63 |window i|s the ac|
|00000b10| 74 69 76 65 20 77 69 6e | 64 6f 77 20 6e 6f 77 20 |tive win|dow now |
|00000b20| 74 65 73 74 20 77 2d 3e | 68 69 6c 69 74 65 64 0d |test w->|hilited.|
|00000b30| 20 2a 20 72 61 74 68 65 | 72 20 74 68 61 6e 20 46 | * rathe|r than F|
|00000b40| 72 6f 6e 74 57 69 6e 64 | 6f 77 28 29 2c 20 73 69 |rontWind|ow(), si|
|00000b50| 6e 63 65 20 74 68 65 20 | 66 72 6f 6e 74 20 77 69 |nce the |front wi|
|00000b60| 6e 64 6f 77 20 6f 66 20 | 61 20 73 75 73 70 65 6e |ndow of |a suspen|
|00000b70| 64 65 64 20 61 70 70 6c | 69 63 61 74 69 6f 6e 0d |ded appl|ication.|
|00000b80| 20 2a 20 69 73 6e 27 74 | 20 61 63 74 69 76 65 2e | * isn't| active.|
|00000b90| 0d 20 2a 20 2d 20 43 68 | 61 6e 67 65 64 20 47 65 |. * - Ch|anged Ge|
|00000ba0| 74 44 57 69 6e 64 6f 77 | 28 29 20 73 6f 20 74 68 |tDWindow|() so th|
|00000bb0| 65 20 57 69 6e 64 6f 77 | 50 74 72 20 69 73 20 72 |e Window|Ptr is r|
|00000bc0| 65 74 75 72 6e 65 64 20 | 61 73 20 74 68 65 20 66 |eturned |as the f|
|00000bd0| 75 6e 63 74 69 6f 6e 20 | 76 61 6c 75 65 0d 20 2a |unction |value. *|
|00000be0| 20 72 61 74 68 65 72 20 | 74 68 61 6e 20 69 6e 20 | rather |than in |
|00000bf0| 74 68 65 20 61 72 67 75 | 6d 65 6e 74 2e 0d 20 2a |the argu|ment.. *|
|00000c00| 20 32 31 20 44 65 63 20 | 39 33 0d 20 2a 20 2d 20 | 21 Dec |93. * - |
|00000c10| 55 73 65 20 63 6f 6c 6f | 72 20 67 72 61 66 70 6f |Use colo|r grafpo|
|00000c20| 72 74 73 20 77 68 65 6e | 20 61 76 61 69 6c 61 62 |rts when| availab|
|00000c30| 6c 65 2e 0d 20 2a 20 30 | 34 20 4a 61 6e 20 39 34 |le.. * 0|4 Jan 94|
|00000c40| 0d 20 2a 20 2d 20 55 6e | 64 69 64 20 49 6e 74 65 |. * - Un|did Inte|
|00000c50| 67 65 72 2f 4c 6f 6e 67 | 49 6e 74 20 74 79 70 65 |ger/Long|Int type|
|00000c60| 20 73 74 75 66 66 20 62 | 61 63 6b 20 74 6f 20 73 | stuff b|ack to s|
|00000c70| 68 6f 72 74 2f 6c 6f 6e | 67 2e 0d 20 2a 0d 20 2a |hort/lon|g.. *. *|
|00000c80| 20 31 38 20 4a 61 6e 20 | 39 34 20 52 65 6c 65 61 | 18 Jan |94 Relea|
|00000c90| 73 65 20 33 2e 30 34 0d | 20 2a 20 2d 20 44 69 73 |se 3.04.| * - Dis|
|00000ca0| 70 6c 61 79 49 6e 74 28 | 29 20 61 6e 64 20 44 69 |playInt(|) and Di|
|00000cb0| 73 70 6c 61 79 48 65 78 | 49 6e 74 28 29 20 61 72 |splayHex|Int() ar|
|00000cc0| 65 20 70 72 6f 62 6c 65 | 6d 61 74 69 63 20 73 69 |e proble|matic si|
|00000cd0| 6e 63 65 20 74 68 65 20 | 54 48 49 4e 4b 20 43 20 |nce the |THINK C |
|00000ce0| 63 61 6e 0d 20 2a 20 74 | 72 65 61 74 20 69 6e 74 |can. * t|reat int|
|00000cf0| 27 73 20 61 73 20 65 69 | 74 68 65 72 20 32 20 6f |'s as ei|ther 2 o|
|00000d00| 72 20 34 20 62 79 74 65 | 73 2e 20 20 41 64 64 65 |r 4 byte|s. Adde|
|00000d10| 64 20 6e 65 77 20 72 6f | 75 74 69 6e 65 73 20 44 |d new ro|utines D|
|00000d20| 69 73 70 6c 61 79 53 68 | 6f 72 74 28 29 0d 20 2a |isplaySh|ort(). *|
|00000d30| 20 61 6e 64 20 44 69 73 | 70 6c 61 79 48 65 78 53 | and Dis|playHexS|
|00000d40| 68 6f 72 74 28 29 20 77 | 68 69 63 68 20 61 72 65 |hort() w|hich are|
|00000d50| 20 75 6e 61 6d 62 69 67 | 75 6f 75 73 20 66 6f 72 | unambig|uous for|
|00000d60| 20 32 20 62 79 74 65 20 | 69 6e 74 65 67 65 72 73 | 2 byte |integers|
|00000d70| 2e 0d 20 2a 20 44 69 73 | 70 6c 61 79 49 6e 74 28 |.. * Dis|playInt(|
|00000d80| 29 20 61 6e 64 20 44 69 | 73 70 6c 61 79 48 65 78 |) and Di|splayHex|
|00000d90| 49 6e 74 28 29 20 61 72 | 65 20 6e 6f 77 20 64 65 |Int() ar|e now de|
|00000da0| 70 72 65 63 61 74 65 64 | 20 61 6e 64 20 77 69 6c |precated| and wil|
|00000db0| 6c 20 64 69 73 61 70 70 | 65 61 72 0d 20 2a 20 69 |l disapp|ear. * i|
|00000dc0| 6e 20 74 68 65 20 66 75 | 74 75 72 65 2e 0d 20 2a |n the fu|ture.. *|
|00000dd0| 20 2d 20 4e 65 77 20 72 | 6f 75 74 69 6e 65 20 44 | - New r|outine D|
|00000de0| 69 73 70 6c 61 79 43 53 | 74 72 69 6e 67 28 29 20 |isplayCS|tring() |
|00000df0| 66 6f 72 20 43 2d 73 74 | 79 6c 65 20 73 74 72 69 |for C-st|yle stri|
|00000e00| 6e 67 73 2e 0d 20 2a 20 | 31 39 20 4a 61 6e 20 39 |ngs.. * |19 Jan 9|
|00000e10| 34 0d 20 2a 20 2d 20 57 | 69 6e 64 6f 77 20 63 72 |4. * - W|indow cr|
|00000e20| 65 61 74 69 6f 6e 20 72 | 6f 75 74 69 6e 65 73 20 |eation r|outines |
|00000e30| 64 6f 20 62 65 74 74 65 | 72 20 63 68 65 63 6b 73 |do bette|r checks|
|00000e40| 20 66 6f 72 20 61 6c 6c | 6f 63 61 74 69 6f 6e 20 | for all|ocation |
|00000e50| 66 61 69 6c 75 72 65 73 | 2e 0d 20 2a 20 2d 20 4d |failures|.. * - M|
|00000e60| 75 63 68 20 72 65 77 72 | 69 74 69 6e 67 20 74 6f |uch rewr|iting to|
|00000e70| 20 65 6c 69 6d 69 6e 61 | 74 65 20 6d 61 6e 79 20 | elimina|te many |
|00000e80| 67 6c 6f 62 61 6c 20 76 | 61 72 69 61 62 6c 65 73 |global v|ariables|
|00000e90| 2e 20 20 4e 6f 20 6d 6f | 72 65 20 53 79 6e 63 47 |. No mo|re SyncG|
|00000ea0| 6c 6f 62 61 6c 73 28 29 | 2e 0d 20 2a 0d 20 2a 20 |lobals()|.. *. * |
|00000eb0| 32 30 20 46 65 62 20 39 | 34 20 52 65 6c 65 61 73 |20 Feb 9|4 Releas|
|00000ec0| 65 20 33 2e 30 35 0d 20 | 2a 20 2d 20 55 70 64 61 |e 3.05. |* - Upda|
|00000ed0| 74 65 64 20 66 6f 72 20 | 54 72 61 6e 73 53 6b 65 |ted for |TransSke|
|00000ee0| 6c 20 33 2e 31 31 2e 0d | 20 2a 20 2d 20 43 6f 6e |l 3.11..| * - Con|
|00000ef0| 76 65 72 74 65 64 20 69 | 6e 74 65 72 66 61 63 65 |verted i|nterface|
|00000f00| 20 74 6f 20 62 65 20 50 | 61 73 63 61 6c 2d 63 6f | to be P|ascal-co|
|00000f10| 6d 70 61 74 69 62 6c 65 | 2e 0d 20 2a 2f 0d 0d 0d |mpatible|.. */...|
|00000f20| 23 20 69 6e 63 6c 75 64 | 65 09 22 54 72 61 6e 73 |# includ|e."Trans|
|00000f30| 53 6b 65 6c 2e 68 22 0d | 0d 23 20 69 6e 63 6c 75 |Skel.h".|.# inclu|
|00000f40| 64 65 09 22 54 72 61 6e | 73 44 69 73 70 6c 61 79 |de."Tran|sDisplay|
|00000f50| 2e 68 22 0d 0d 0d 23 20 | 64 65 66 69 6e 65 09 6e |.h"...# |define.n|
|00000f60| 6f 72 6d 61 6c 48 69 6c | 69 74 65 09 30 0d 23 20 |ormalHil|ite.0.# |
|00000f70| 64 65 66 69 6e 65 09 64 | 69 6d 48 69 6c 69 74 65 |define.d|imHilite|
|00000f80| 09 09 32 35 35 0d 0d 23 | 20 64 65 66 69 6e 65 09 |..255..#| define.|
|00000f90| 57 69 6e 64 6f 77 49 73 | 41 63 74 69 76 65 28 77 |WindowIs|Active(w|
|00000fa0| 29 09 28 28 57 69 6e 64 | 6f 77 50 65 65 6b 29 20 |).((Wind|owPeek) |
|00000fb0| 28 77 29 29 2d 3e 68 69 | 6c 69 74 65 64 0d 0d 0d |(w))->hi|lited...|
|00000fc0| 2f 2a 0d 20 2a 20 4e 65 | 77 28 54 79 70 65 4e 61 |/*. * Ne|w(TypeNa|
|00000fd0| 6d 65 29 20 72 65 74 75 | 72 6e 73 20 68 61 6e 64 |me) retu|rns hand|
|00000fe0| 6c 65 20 74 6f 20 6e 65 | 77 20 6f 62 6a 65 63 74 |le to ne|w object|
|00000ff0| 2c 20 66 6f 72 20 61 6e | 79 20 54 79 70 65 4e 61 |, for an|y TypeNa|
|00001000| 6d 65 2e 0d 20 2a 20 49 | 66 20 74 68 65 72 65 20 |me.. * I|f there |
|00001010| 69 73 20 69 6e 73 75 66 | 66 69 63 69 65 6e 74 20 |is insuf|ficient |
|00001020| 6d 65 6d 6f 72 79 2c 20 | 74 68 65 20 72 65 73 75 |memory, |the resu|
|00001030| 6c 74 20 69 73 20 6e 69 | 6c 2e 0d 20 2a 2f 0d 0d |lt is ni|l.. */..|
|00001040| 23 20 64 65 66 69 6e 65 | 09 4e 65 77 28 74 79 70 |# define|.New(typ|
|00001050| 65 29 09 28 74 79 70 65 | 20 2a 2a 29 20 4e 65 77 |e).(type| **) New|
|00001060| 48 61 6e 64 6c 65 20 28 | 28 53 69 7a 65 29 20 73 |Handle (|(Size) s|
|00001070| 69 7a 65 6f 66 20 28 74 | 79 70 65 29 29 0d 0d 0d |izeof (t|ype))...|
|00001080| 2f 2a 0d 20 2a 20 44 65 | 66 61 75 6c 74 20 76 61 |/*. * De|fault va|
|00001090| 6c 75 65 73 20 66 6f 72 | 20 64 69 73 70 6c 61 79 |lues for| display|
|000010a0| 20 77 69 6e 64 6f 77 20 | 63 68 61 72 61 63 74 65 | window |characte|
|000010b0| 72 69 73 74 69 63 73 2e | 20 20 55 73 65 64 20 77 |ristics.| Used w|
|000010c0| 68 65 6e 0d 20 2a 20 6e | 65 77 20 64 69 73 70 6c |hen. * n|ew displ|
|000010d0| 61 79 20 77 69 6e 64 6f | 77 73 20 61 72 65 20 63 |ay windo|ws are c|
|000010e0| 72 65 61 74 65 64 2e 0d | 20 2a 2f 0d 0d 73 74 61 |reated..| */..sta|
|000010f0| 74 69 63 20 73 68 6f 72 | 74 09 64 5f 66 6f 6e 74 |tic shor|t.d_font|
|00001100| 20 3d 20 6d 6f 6e 61 63 | 6f 3b 09 09 2f 2a 20 64 | = monac|o;../* d|
|00001110| 65 66 61 75 6c 74 20 66 | 6f 6e 74 20 20 20 20 20 |efault f|ont |
|00001120| 20 20 20 20 20 20 20 20 | 20 2a 2f 0d 73 74 61 74 | | */.stat|
|00001130| 69 63 20 73 68 6f 72 74 | 09 64 5f 73 69 7a 65 20 |ic short|.d_size |
|00001140| 3d 20 39 3b 09 09 09 09 | 2f 2a 20 64 65 66 61 75 |= 9;....|/* defau|
|00001150| 6c 74 20 70 6f 69 6e 74 | 73 69 7a 65 20 20 20 20 |lt point|size |
|00001160| 20 20 20 20 20 2a 2f 0d | 73 74 61 74 69 63 20 73 | */.|static s|
|00001170| 68 6f 72 74 09 64 5f 77 | 72 61 70 20 3d 20 30 3b |hort.d_w|rap = 0;|
|00001180| 09 09 09 09 2f 2a 20 64 | 65 66 61 75 6c 74 20 77 |..../* d|efault w|
|00001190| 6f 72 64 20 77 72 61 70 | 20 28 6f 6e 29 20 20 20 |ord wrap| (on) |
|000011a0| 20 2a 2f 0d 73 74 61 74 | 69 63 20 73 68 6f 72 74 | */.stat|ic short|
|000011b0| 09 64 5f 6a 75 73 74 20 | 3d 20 74 65 4a 75 73 74 |.d_just |= teJust|
|000011c0| 4c 65 66 74 3b 09 2f 2a | 20 64 65 66 61 75 6c 74 |Left;./*| default|
|000011d0| 20 6a 75 73 74 69 66 69 | 63 61 74 69 6f 6e 20 20 | justifi|cation |
|000011e0| 20 20 20 2a 2f 0d 73 74 | 61 74 69 63 20 6c 6f 6e | */.st|atic lon|
|000011f0| 67 09 64 5f 6d 61 78 54 | 65 78 74 20 3d 20 33 30 |g.d_maxT|ext = 30|
|00001200| 30 30 30 4c 3b 09 09 2f | 2a 20 64 65 66 61 75 6c |000L;../|* defaul|
|00001210| 74 20 6d 61 78 20 74 65 | 78 74 20 61 6c 6c 6f 77 |t max te|xt allow|
|00001220| 65 64 20 20 2a 2f 0d 73 | 74 61 74 69 63 20 6c 6f |ed */.s|tatic lo|
|00001230| 6e 67 09 64 5f 66 6c 75 | 73 68 41 6d 74 20 3d 20 |ng.d_flu|shAmt = |
|00001240| 32 35 30 30 30 4c 3b 09 | 2f 2a 20 64 65 66 61 75 |25000L;.|/* defau|
|00001250| 6c 74 20 61 75 74 6f 66 | 6c 75 73 68 20 61 6d 6f |lt autof|lush amo|
|00001260| 75 6e 74 20 20 2a 2f 0d | 73 74 61 74 69 63 20 54 |unt */.|static T|
|00001270| 44 69 73 70 41 63 74 69 | 76 61 74 65 50 72 6f 63 |DispActi|vateProc|
|00001280| 50 74 72 09 09 64 5f 61 | 63 74 69 76 61 74 65 20 |Ptr..d_a|ctivate |
|00001290| 3d 20 28 54 44 69 73 70 | 41 63 74 69 76 61 74 65 |= (TDisp|Activate|
|000012a0| 50 72 6f 63 50 74 72 29 | 20 6e 69 6c 3b 09 2f 2a |ProcPtr)| nil;./*|
|000012b0| 20 64 65 66 61 75 6c 74 | 20 6e 6f 74 69 66 69 63 | default| notific|
|000012c0| 61 74 69 6f 6e 20 70 72 | 6f 63 20 2a 2f 0d 0d 0d |ation pr|oc */...|
|000012d0| 2f 2a 0d 20 2a 20 4c 6f | 77 65 73 74 20 61 6c 6c |/*. * Lo|west all|
|000012e0| 6f 77 61 62 6c 65 20 76 | 61 6c 75 65 73 20 66 6f |owable v|alues fo|
|000012f0| 72 20 61 75 74 6f 66 6c | 75 73 68 20 63 68 61 72 |r autofl|ush char|
|00001300| 61 63 74 65 72 69 73 74 | 69 63 73 0d 20 2a 2f 0d |acterist|ics. */.|
|00001310| 0d 23 20 64 65 66 69 6e | 65 09 64 5f 6c 6f 4d 61 |.# defin|e.d_loMa|
|00001320| 78 54 65 78 74 09 09 28 | 31 30 30 4c 29 0d 23 20 |xText..(|100L).# |
|00001330| 64 65 66 69 6e 65 09 64 | 5f 6c 6f 46 6c 75 73 68 |define.d|_loFlush|
|00001340| 41 6d 74 09 28 31 30 30 | 4c 29 0d 0d 0d 2f 2a 0d |Amt.(100|L).../*.|
|00001350| 20 2a 20 44 69 73 70 6c | 61 79 20 77 69 6e 64 6f | * Displ|ay windo|
|00001360| 77 20 64 6f 63 75 6d 65 | 6e 74 20 72 65 63 6f 72 |w docume|nt recor|
|00001370| 64 2e 20 20 41 20 68 61 | 6e 64 6c 65 20 74 6f 20 |d. A ha|ndle to |
|00001380| 61 20 77 69 6e 64 6f 77 | 27 73 20 64 6f 63 75 6d |a window|'s docum|
|00001390| 65 6e 74 0d 20 2a 20 72 | 65 63 6f 72 64 20 69 73 |ent. * r|ecord is|
|000013a0| 20 73 74 6f 72 65 64 20 | 69 6e 20 74 68 65 20 77 | stored |in the w|
|000013b0| 69 6e 64 6f 77 27 73 20 | 70 72 6f 70 65 72 74 79 |indow's |property|
|000013c0| 20 6c 69 73 74 2e 0d 20 | 2a 2f 0d 0d 74 79 70 65 | list.. |*/..type|
|000013d0| 64 65 66 20 73 74 72 75 | 63 74 20 44 6f 63 52 65 |def stru|ct DocRe|
|000013e0| 63 6f 72 64 20 44 6f 63 | 52 65 63 6f 72 64 2c 20 |cord Doc|Record, |
|000013f0| 2a 44 6f 63 50 74 72 2c | 20 2a 2a 44 6f 63 48 61 |*DocPtr,| **DocHa|
|00001400| 6e 64 6c 65 3b 0d 0d 73 | 74 72 75 63 74 20 44 6f |ndle;..s|truct Do|
|00001410| 63 52 65 63 6f 72 64 0d | 7b 0d 09 57 69 6e 64 6f |cRecord.|{..Windo|
|00001420| 77 50 74 72 09 09 09 09 | 64 57 69 6e 64 3b 09 09 |wPtr....|dWind;..|
|00001430| 2f 2a 20 64 69 73 70 6c | 61 79 20 77 69 6e 64 6f |/* displ|ay windo|
|00001440| 77 20 20 20 20 20 20 20 | 20 20 2a 2f 0d 09 54 45 |w | */..TE|
|00001450| 48 61 6e 64 6c 65 09 09 | 09 09 64 54 45 3b 09 09 |Handle..|..dTE;..|
|00001460| 2f 2a 20 77 69 6e 64 6f | 77 20 74 65 78 74 20 20 |/* windo|w text |
|00001470| 20 20 20 20 20 20 20 20 | 20 20 2a 2f 0d 09 43 6f | | */..Co|
|00001480| 6e 74 72 6f 6c 48 61 6e | 64 6c 65 09 09 09 64 53 |ntrolHan|dle...dS|
|00001490| 63 72 6f 6c 6c 3b 09 2f | 2a 20 77 69 6e 64 6f 77 |croll;./|* window|
|000014a0| 20 73 63 72 6f 6c 6c 20 | 62 61 72 20 20 20 20 20 | scroll |bar |
|000014b0| 20 2a 2f 0d 09 54 44 69 | 73 70 41 63 74 69 76 61 | */..TDi|spActiva|
|000014c0| 74 65 50 72 6f 63 50 74 | 72 09 64 41 63 74 69 76 |teProcPt|r.dActiv|
|000014d0| 61 74 65 3b 09 2f 2a 20 | 6e 6f 74 69 66 69 63 61 |ate;./* |notifica|
|000014e0| 74 69 6f 6e 20 70 72 6f | 63 65 64 75 72 65 20 2a |tion pro|cedure *|
|000014f0| 2f 0d 09 6c 6f 6e 67 09 | 09 09 09 09 64 4d 61 78 |/..long.|....dMax|
|00001500| 54 65 78 74 3b 09 2f 2a | 20 6d 61 78 20 74 65 78 |Text;./*| max tex|
|00001510| 74 20 6c 65 6e 67 74 68 | 20 20 20 20 20 20 20 20 |t length| |
|00001520| 2a 2f 0d 09 6c 6f 6e 67 | 09 09 09 09 09 64 46 6c |*/..long|.....dFl|
|00001530| 75 73 68 41 6d 74 3b 09 | 2f 2a 20 61 6d 6f 75 6e |ushAmt;.|/* amoun|
|00001540| 74 20 74 6f 20 61 75 74 | 6f 66 6c 75 73 68 20 20 |t to aut|oflush |
|00001550| 20 20 2a 2f 0d 7d 3b 0d | 0d 0d 2f 2a 0d 20 2a 20 | */.};.|../*. * |
|00001560| 4d 61 63 72 6f 73 20 66 | 6f 72 20 61 63 63 65 73 |Macros f|or acces|
|00001570| 73 69 6e 67 20 70 61 72 | 74 73 20 6f 66 20 61 20 |sing par|ts of a |
|00001580| 64 6f 63 75 6d 65 6e 74 | 20 72 65 63 6f 72 64 2c |document| record,|
|00001590| 20 67 69 76 65 6e 20 61 | 20 64 6f 63 75 6d 65 6e | given a| documen|
|000015a0| 74 0d 20 2a 20 68 61 6e | 64 6c 65 2e 0d 20 2a 2f |t. * han|dle.. */|
|000015b0| 0d 0d 23 20 64 65 66 69 | 6e 65 09 44 6f 63 57 69 |..# defi|ne.DocWi|
|000015c0| 6e 64 28 64 6f 63 29 09 | 09 09 28 28 2a 2a 64 6f |nd(doc).|..((**do|
|000015d0| 63 29 2e 64 57 69 6e 64 | 29 0d 23 20 64 65 66 69 |c).dWind|).# defi|
|000015e0| 6e 65 09 44 6f 63 54 45 | 28 64 6f 63 29 09 09 09 |ne.DocTE|(doc)...|
|000015f0| 09 28 28 2a 2a 64 6f 63 | 29 2e 64 54 45 29 0d 23 |.((**doc|).dTE).#|
|00001600| 20 64 65 66 69 6e 65 09 | 44 6f 63 53 63 72 6f 6c | define.|DocScrol|
|00001610| 6c 28 64 6f 63 29 09 09 | 09 28 28 2a 2a 64 6f 63 |l(doc)..|.((**doc|
|00001620| 29 2e 64 53 63 72 6f 6c | 6c 29 0d 23 20 64 65 66 |).dScrol|l).# def|
|00001630| 69 6e 65 09 44 6f 63 41 | 63 74 69 76 61 74 65 50 |ine.DocA|ctivateP|
|00001640| 72 6f 63 28 64 6f 63 29 | 09 28 28 2a 2a 64 6f 63 |roc(doc)|.((**doc|
|00001650| 29 2e 64 41 63 74 69 76 | 61 74 65 29 0d 23 20 64 |).dActiv|ate).# d|
|00001660| 65 66 69 6e 65 09 44 6f | 63 4d 61 78 54 65 78 74 |efine.Do|cMaxText|
|00001670| 28 64 6f 63 29 09 09 09 | 28 28 2a 2a 64 6f 63 29 |(doc)...|((**doc)|
|00001680| 2e 64 4d 61 78 54 65 78 | 74 29 0d 23 20 64 65 66 |.dMaxTex|t).# def|
|00001690| 69 6e 65 09 44 6f 63 46 | 6c 75 73 68 41 6d 74 28 |ine.DocF|lushAmt(|
|000016a0| 64 6f 63 29 09 09 28 28 | 2a 2a 64 6f 63 29 2e 64 |doc)..((|**doc).d|
|000016b0| 46 6c 75 73 68 41 6d 74 | 29 0d 0d 0d 2f 2a 0d 20 |FlushAmt|).../*. |
|000016c0| 2a 20 63 75 72 44 69 73 | 70 57 69 6e 64 20 69 73 |* curDis|pWind is|
|000016d0| 20 74 68 65 20 63 75 72 | 72 65 6e 74 20 6f 75 74 | the cur|rent out|
|000016e0| 70 75 74 20 77 69 6e 64 | 6f 77 2e 0d 20 2a 20 49 |put wind|ow.. * I|
|000016f0| 66 20 63 75 72 44 69 73 | 70 57 69 6e 64 20 3d 20 |f curDis|pWind = |
|00001700| 6e 69 6c 2c 20 6f 75 74 | 70 75 74 20 69 73 20 63 |nil, out|put is c|
|00001710| 75 72 72 65 6e 74 6c 79 | 20 74 75 72 6e 65 64 20 |urrently| turned |
|00001720| 6f 66 66 2e 0d 20 2a 2f | 0d 0d 73 74 61 74 69 63 |off.. */|..static|
|00001730| 20 57 69 6e 64 6f 77 50 | 74 72 09 63 75 72 44 69 | WindowP|tr.curDi|
|00001740| 73 70 57 69 6e 64 20 3d | 20 6e 69 6c 3b 0d 0d 0d |spWind =| nil;...|
|00001750| 0d 2f 2a 20 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |./* ----|--------|
|00001760| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001770| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001780| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001790| 2d 2d 2d 2d 2d 2d 2d 2d | 20 2a 2f 0d 2f 2a 09 09 |--------| */./*..|
|000017a0| 09 09 4d 69 73 63 65 6c | 6c 61 6e 65 6f 75 73 20 |..Miscel|laneous |
|000017b0| 49 6e 74 65 72 6e 61 6c | 20 28 70 72 69 76 61 74 |Internal| (privat|
|000017c0| 65 29 20 52 6f 75 74 69 | 6e 65 73 09 09 09 09 2a |e) Routi|nes....*|
|000017d0| 2f 0d 2f 2a 20 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |/./* ---|--------|
|000017e0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000017f0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001800| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001810| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 20 2a 2f 0d 0d 0d 2f |--------|- */.../|
|00001820| 2a 0d 20 2a 20 44 72 61 | 77 20 67 72 6f 77 20 62 |*. * Dra|w grow b|
|00001830| 6f 78 20 6f 66 20 64 69 | 73 70 57 69 6e 64 20 69 |ox of di|spWind i|
|00001840| 6e 20 6c 6f 77 65 72 20 | 72 69 67 68 74 20 68 61 |n lower |right ha|
|00001850| 6e 64 20 63 6f 72 6e 65 | 72 0d 20 2a 2f 0d 0d 0d |nd corne|r. */...|
|00001860| 73 74 61 74 69 63 20 76 | 6f 69 64 0d 44 72 61 77 |static v|oid.Draw|
|00001870| 47 72 6f 77 42 6f 78 20 | 28 57 69 6e 64 6f 77 50 |GrowBox |(WindowP|
|00001880| 74 72 20 77 29 0d 7b 0d | 52 67 6e 48 61 6e 64 6c |tr w).{.|RgnHandl|
|00001890| 65 09 6f 6c 64 43 6c 69 | 70 3b 0d 52 65 63 74 09 |e.oldCli|p;.Rect.|
|000018a0| 09 72 3b 0d 0d 09 72 20 | 3d 20 77 2d 3e 70 6f 72 |.r;...r |= w->por|
|000018b0| 74 52 65 63 74 3b 0d 09 | 72 2e 6c 65 66 74 20 3d |tRect;..|r.left =|
|000018c0| 20 72 2e 72 69 67 68 74 | 20 2d 20 31 35 3b 09 09 | r.right| - 15;..|
|000018d0| 2f 2a 20 64 72 61 77 20 | 6f 6e 6c 79 20 69 6e 20 |/* draw |only in |
|000018e0| 63 6f 72 6e 65 72 20 2a | 2f 0d 09 72 2e 74 6f 70 |corner *|/..r.top|
|000018f0| 20 3d 20 72 2e 62 6f 74 | 74 6f 6d 20 2d 20 31 35 | = r.bot|tom - 15|
|00001900| 3b 0d 09 6f 6c 64 43 6c | 69 70 20 3d 20 4e 65 77 |;..oldCl|ip = New|
|00001910| 52 67 6e 20 28 29 3b 0d | 09 47 65 74 43 6c 69 70 |Rgn ();.|.GetClip|
|00001920| 20 28 6f 6c 64 43 6c 69 | 70 29 3b 0d 09 43 6c 69 | (oldCli|p);..Cli|
|00001930| 70 52 65 63 74 20 28 26 | 72 29 3b 0d 09 44 72 61 |pRect (&|r);..Dra|
|00001940| 77 47 72 6f 77 49 63 6f | 6e 20 28 77 29 3b 0d 09 |wGrowIco|n (w);..|
|00001950| 53 65 74 43 6c 69 70 20 | 28 6f 6c 64 43 6c 69 70 |SetClip |(oldClip|
|00001960| 29 3b 0d 09 44 69 73 70 | 6f 73 65 52 67 6e 20 28 |);..Disp|oseRgn (|
|00001970| 6f 6c 64 43 6c 69 70 29 | 3b 0d 7d 0d 0d 0d 0d 2f |oldClip)|;.}..../|
|00001980| 2a 20 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |* ------|--------|
|00001990| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000019a0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000019b0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000019c0| 2d 2d 2d 2d 2d 2d 20 2a | 2f 0d 2f 2a 09 09 09 4c |------ *|/./*...L|
|000019d0| 6f 77 65 73 74 2d 6c 65 | 76 65 6c 20 49 6e 74 65 |owest-le|vel Inte|
|000019e0| 72 6e 61 6c 20 28 50 72 | 69 76 61 74 65 29 20 44 |rnal (Pr|ivate) D|
|000019f0| 69 73 70 6c 61 79 20 57 | 69 6e 64 6f 77 20 52 6f |isplay W|indow Ro|
|00001a00| 75 74 69 6e 65 73 09 09 | 2a 2f 0d 2f 2a 20 2d 2d |utines..|*/./* --|
|00001a10| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001a20| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001a30| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001a40| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001a50| 2d 2d 20 2a 2f 0d 0d 0d | 2f 2a 0d 20 2a 20 47 65 |-- */...|/*. * Ge|
|00001a60| 74 20 64 6f 63 75 6d 65 | 6e 74 20 68 61 6e 64 6c |t docume|nt handl|
|00001a70| 65 20 61 73 73 6f 63 69 | 61 74 65 64 20 77 69 74 |e associ|ated wit|
|00001a80| 68 20 64 69 73 70 6c 61 | 79 20 77 69 6e 64 6f 77 |h displa|y window|
|00001a90| 2e 0d 20 2a 20 52 65 74 | 75 72 6e 20 6e 69 6c 20 |.. * Ret|urn nil |
|00001aa0| 69 66 20 77 69 6e 64 6f | 77 20 69 73 6e 27 74 20 |if windo|w isn't |
|00001ab0| 61 20 6b 6e 6f 77 6e 20 | 64 69 73 70 6c 61 79 20 |a known |display |
|00001ac0| 77 69 6e 64 6f 77 2e 0d | 20 2a 2f 0d 0d 73 74 61 |window..| */..sta|
|00001ad0| 74 69 63 20 44 6f 63 48 | 61 6e 64 6c 65 0d 57 69 |tic DocH|andle.Wi|
|00001ae0| 6e 64 44 6f 63 48 61 6e | 64 6c 65 20 28 57 69 6e |ndDocHan|dle (Win|
|00001af0| 64 6f 77 50 74 72 20 77 | 29 0d 7b 0d 53 6b 65 6c |dowPtr w|).{.Skel|
|00001b00| 57 69 6e 64 50 72 6f 70 | 48 61 6e 64 6c 65 09 70 |WindProp|Handle.p|
|00001b10| 68 3b 0d 44 6f 63 48 61 | 6e 64 6c 65 09 64 6f 63 |h;.DocHa|ndle.doc|
|00001b20| 20 3d 20 28 44 6f 63 48 | 61 6e 64 6c 65 29 20 6e | = (DocH|andle) n|
|00001b30| 69 6c 3b 0d 0d 09 69 66 | 20 28 77 20 21 3d 20 28 |il;...if| (w != (|
|00001b40| 57 69 6e 64 6f 77 50 74 | 72 29 20 6e 69 6c 29 0d |WindowPt|r) nil).|
|00001b50| 09 7b 0d 09 09 70 68 20 | 3d 20 53 6b 65 6c 47 65 |.{...ph |= SkelGe|
|00001b60| 74 57 69 6e 64 50 72 6f | 70 20 28 77 2c 20 73 6b |tWindPro|p (w, sk|
|00001b70| 65 6c 57 50 72 6f 70 44 | 69 73 70 6c 61 79 57 69 |elWPropD|isplayWi|
|00001b80| 6e 64 29 3b 0d 09 09 69 | 66 20 28 70 68 20 21 3d |nd);...i|f (ph !=|
|00001b90| 20 28 53 6b 65 6c 57 69 | 6e 64 50 72 6f 70 48 61 | (SkelWi|ndPropHa|
|00001ba0| 6e 64 6c 65 29 20 6e 69 | 6c 29 0d 09 09 09 64 6f |ndle) ni|l)....do|
|00001bb0| 63 20 3d 20 28 44 6f 63 | 48 61 6e 64 6c 65 29 20 |c = (Doc|Handle) |
|00001bc0| 28 2a 2a 70 68 29 2e 73 | 6b 65 6c 57 50 72 6f 70 |(**ph).s|kelWProp|
|00001bd0| 44 61 74 61 3b 0d 09 7d | 0d 09 72 65 74 75 72 6e |Data;..}|..return|
|00001be0| 20 28 64 6f 63 29 3b 0d | 7d 0d 0d 0d 2f 2a 0d 20 | (doc);.|}.../*. |
|00001bf0| 2a 20 43 61 6c 63 75 6c | 61 74 65 20 74 68 65 20 |* Calcul|ate the |
|00001c00| 64 69 6d 65 6e 73 69 6f | 6e 73 20 6f 66 20 74 68 |dimensio|ns of th|
|00001c10| 65 20 65 64 69 74 69 6e | 67 20 72 65 63 74 61 6e |e editin|g rectan|
|00001c20| 67 6c 65 20 66 6f 72 0d | 20 2a 20 61 20 77 69 6e |gle for.| * a win|
|00001c30| 64 6f 77 20 28 77 68 69 | 63 68 20 69 73 20 61 73 |dow (whi|ch is as|
|00001c40| 73 75 6d 65 64 20 74 6f | 20 62 65 0d 20 2a 20 74 |sumed to| be. * t|
|00001c50| 68 65 20 63 75 72 72 65 | 6e 74 20 70 6f 72 74 29 |he curre|nt port)|
|00001c60| 2e 20 20 28 54 68 65 20 | 76 69 65 77 52 65 63 74 |. (The |viewRect|
|00001c70| 20 61 6e 64 20 64 65 73 | 74 52 65 63 74 20 61 72 | and des|tRect ar|
|00001c80| 65 20 74 68 65 0d 20 2a | 20 73 61 6d 65 20 73 69 |e the. *| same si|
|00001c90| 7a 65 2e 29 20 20 41 73 | 73 75 6d 65 73 20 74 68 |ze.) As|sumes th|
|00001ca0| 65 20 70 6f 72 74 2c 20 | 74 65 78 74 20 66 6f 6e |e port, |text fon|
|00001cb0| 74 20 61 6e 64 20 74 65 | 78 74 20 73 69 7a 65 20 |t and te|xt size |
|00001cc0| 61 72 65 20 61 6c 6c 0d | 20 2a 20 73 65 74 20 70 |are all.| * set p|
|00001cd0| 72 6f 70 65 72 6c 79 2e | 20 20 54 68 65 20 76 69 |roperly.| The vi|
|00001ce0| 65 77 52 65 63 74 20 69 | 73 20 73 69 7a 65 64 20 |ewRect i|s sized |
|00001cf0| 73 6f 20 74 68 61 74 20 | 61 6e 20 69 6e 74 65 67 |so that |an integ|
|00001d00| 72 61 6c 0d 20 2a 20 6e | 75 6d 62 65 72 20 6f 66 |ral. * n|umber of|
|00001d10| 20 6c 69 6e 65 73 20 63 | 61 6e 20 62 65 20 64 69 | lines c|an be di|
|00001d20| 73 70 6c 61 79 65 64 20 | 69 6e 20 69 74 2c 20 69 |splayed |in it, i|
|00001d30| 2e 65 2e 2c 20 73 6f 20 | 74 68 61 74 20 61 0d 20 |.e., so |that a. |
|00001d40| 2a 20 70 61 72 74 69 61 | 6c 20 6c 69 6e 65 20 6e |* partia|l line n|
|00001d50| 65 76 65 72 20 73 68 6f | 77 73 20 61 74 20 74 68 |ever sho|ws at th|
|00001d60| 65 20 62 6f 74 74 6f 6d | 2e 0d 20 2a 2f 0d 0d 73 |e bottom|.. */..s|
|00001d70| 74 61 74 69 63 20 76 6f | 69 64 0d 43 61 6c 63 45 |tatic vo|id.CalcE|
|00001d80| 64 69 74 52 65 63 74 20 | 28 57 69 6e 64 6f 77 50 |ditRect |(WindowP|
|00001d90| 74 72 20 77 2c 20 52 65 | 63 74 20 2a 72 29 0d 7b |tr w, Re|ct *r).{|
|00001da0| 0d 46 6f 6e 74 49 6e 66 | 6f 09 66 3b 0d 73 68 6f |.FontInf|o.f;.sho|
|00001db0| 72 74 09 09 6c 69 6e 65 | 48 65 69 67 68 74 3b 0d |rt..line|Height;.|
|00001dc0| 0d 09 47 65 74 46 6f 6e | 74 49 6e 66 6f 20 28 26 |..GetFon|tInfo (&|
|00001dd0| 66 29 3b 0d 09 6c 69 6e | 65 48 65 69 67 68 74 20 |f);..lin|eHeight |
|00001de0| 3d 20 66 2e 61 73 63 65 | 6e 74 20 2b 20 66 2e 64 |= f.asce|nt + f.d|
|00001df0| 65 73 63 65 6e 74 20 2b | 20 66 2e 6c 65 61 64 69 |escent +| f.leadi|
|00001e00| 6e 67 3b 0d 09 2a 72 20 | 3d 20 77 2d 3e 70 6f 72 |ng;..*r |= w->por|
|00001e10| 74 52 65 63 74 3b 0d 09 | 72 2d 3e 6c 65 66 74 20 |tRect;..|r->left |
|00001e20| 2b 3d 20 34 3b 0d 09 72 | 2d 3e 72 69 67 68 74 20 |+= 4;..r|->right |
|00001e30| 2d 3d 20 31 37 3b 09 09 | 09 2f 2a 20 6c 65 61 76 |-= 17;..|./* leav|
|00001e40| 65 20 72 6f 6f 6d 20 66 | 6f 72 20 73 63 72 6f 6c |e room f|or scrol|
|00001e50| 6c 20 62 61 72 20 2b 20 | 32 20 2a 2f 0d 09 72 2d |l bar + |2 */..r-|
|00001e60| 3e 74 6f 70 20 2b 3d 20 | 32 3b 0d 09 72 2d 3e 62 |>top += |2;..r->b|
|00001e70| 6f 74 74 6f 6d 20 3d 20 | 72 2d 3e 74 6f 70 20 2b |ottom = |r->top +|
|00001e80| 20 28 28 72 2d 3e 62 6f | 74 74 6f 6d 20 2d 20 72 | ((r->bo|ttom - r|
|00001e90| 2d 3e 74 6f 70 20 2d 20 | 32 29 20 2f 20 6c 69 6e |->top - |2) / lin|
|00001ea0| 65 48 65 69 67 68 74 29 | 20 2a 20 6c 69 6e 65 48 |eHeight)| * lineH|
|00001eb0| 65 69 67 68 74 3b 0d 7d | 0d 0d 0d 2f 2a 0d 20 2a |eight;.}|.../*. *|
|00001ec0| 20 43 61 6c 63 75 6c 61 | 74 65 20 74 68 65 20 64 | Calcula|te the d|
|00001ed0| 69 6d 65 6e 73 69 6f 6e | 73 20 6f 66 20 74 68 65 |imension|s of the|
|00001ee0| 20 73 63 72 6f 6c 6c 20 | 62 61 72 20 72 65 63 74 | scroll |bar rect|
|00001ef0| 61 6e 67 6c 65 20 66 6f | 72 20 61 0d 20 2a 20 77 |angle fo|r a. * w|
|00001f00| 69 6e 64 6f 77 2e 20 20 | 4d 61 6b 65 20 73 75 72 |indow. |Make sur|
|00001f10| 65 20 74 68 61 74 20 74 | 68 65 20 65 64 67 65 73 |e that t|he edges|
|00001f20| 20 6f 76 65 72 6c 61 70 | 20 74 68 65 20 77 69 6e | overlap| the win|
|00001f30| 64 6f 77 20 66 72 61 6d | 65 20 61 6e 64 0d 20 2a |dow fram|e and. *|
|00001f40| 20 74 68 65 20 67 72 6f | 77 20 62 6f 78 2e 0d 20 | the gro|w box.. |
|00001f50| 2a 2f 0d 0d 73 74 61 74 | 69 63 20 76 6f 69 64 0d |*/..stat|ic void.|
|00001f60| 43 61 6c 63 53 63 72 6f | 6c 6c 52 65 63 74 20 28 |CalcScro|llRect (|
|00001f70| 57 69 6e 64 6f 77 50 74 | 72 20 77 2c 20 52 65 63 |WindowPt|r w, Rec|
|00001f80| 74 20 2a 72 29 0d 7b 0d | 09 2a 72 20 3d 20 77 2d |t *r).{.|.*r = w-|
|00001f90| 3e 70 6f 72 74 52 65 63 | 74 3b 0d 09 2b 2b 72 2d |>portRec|t;..++r-|
|00001fa0| 3e 72 69 67 68 74 3b 0d | 09 2d 2d 72 2d 3e 74 6f |>right;.|.--r->to|
|00001fb0| 70 3b 0d 09 72 2d 3e 6c | 65 66 74 20 3d 20 72 2d |p;..r->l|eft = r-|
|00001fc0| 3e 72 69 67 68 74 20 2d | 20 31 36 3b 0d 09 72 2d |>right -| 16;..r-|
|00001fd0| 3e 62 6f 74 74 6f 6d 20 | 2d 3d 20 31 34 3b 0d 7d |>bottom |-= 14;.}|
|00001fe0| 0d 0d 0d 2f 2a 0d 20 2a | 20 43 61 6c 63 75 6c 61 |.../*. *| Calcula|
|00001ff0| 74 65 20 74 68 65 20 6e | 75 6d 62 65 72 20 6f 66 |te the n|umber of|
|00002000| 20 6c 69 6e 65 73 20 63 | 75 72 72 65 6e 74 6c 79 | lines c|urrently|
|00002010| 20 73 63 72 6f 6c 6c 65 | 64 20 6f 66 66 0d 20 2a | scrolle|d off. *|
|00002020| 20 74 68 65 20 74 6f 70 | 20 6f 66 20 61 6e 20 65 | the top| of an e|
|00002030| 64 69 74 20 72 65 63 6f | 72 64 2e 0d 20 2a 2f 0d |dit reco|rd.. */.|
|00002040| 0d 73 74 61 74 69 63 20 | 73 68 6f 72 74 0d 4c 69 |.static |short.Li|
|00002050| 6e 65 73 4f 66 66 54 6f | 70 20 28 54 45 48 61 6e |nesOffTo|p (TEHan|
|00002060| 64 6c 65 20 68 54 45 29 | 0d 7b 0d 09 72 65 74 75 |dle hTE)|.{..retu|
|00002070| 72 6e 20 28 28 28 2a 2a | 68 54 45 29 2e 76 69 65 |rn (((**|hTE).vie|
|00002080| 77 52 65 63 74 2e 74 6f | 70 20 2d 20 28 2a 2a 68 |wRect.to|p - (**h|
|00002090| 54 45 29 2e 64 65 73 74 | 52 65 63 74 2e 74 6f 70 |TE).dest|Rect.top|
|000020a0| 29 20 2f 20 28 2a 2a 68 | 54 45 29 2e 6c 69 6e 65 |) / (**h|TE).line|
|000020b0| 48 65 69 67 68 74 29 3b | 0d 7d 0d 0d 0d 2f 2a 0d |Height);|.}.../*.|
|000020c0| 20 2a 20 48 69 67 68 6c | 69 67 68 74 20 74 68 65 | * Highl|ight the|
|000020d0| 20 73 63 72 6f 6c 6c 20 | 62 61 72 20 70 72 6f 70 | scroll |bar prop|
|000020e0| 65 72 6c 79 2e 20 20 54 | 68 69 73 20 6d 65 61 6e |erly. T|his mean|
|000020f0| 73 20 74 68 61 74 20 69 | 74 27 73 20 6e 6f 74 0d |s that i|t's not.|
|00002100| 20 2a 20 6d 61 64 65 20 | 61 63 74 69 76 65 20 69 | * made |active i|
|00002110| 66 20 74 68 65 20 77 69 | 6e 64 6f 77 20 69 74 73 |f the wi|ndow its|
|00002120| 65 6c 66 20 69 73 6e 27 | 74 20 61 63 74 69 76 65 |elf isn'|t active|
|00002130| 2c 20 65 76 65 6e 20 69 | 66 0d 20 2a 20 74 68 65 |, even i|f. * the|
|00002140| 72 65 27 73 20 65 6e 6f | 75 67 68 20 74 65 78 74 |re's eno|ugh text|
|00002150| 20 74 6f 20 66 69 6c 6c | 20 74 68 65 20 77 69 6e | to fill| the win|
|00002160| 64 6f 77 2e 0d 20 2a 2f | 0d 0d 73 74 61 74 69 63 |dow.. */|..static|
|00002170| 20 76 6f 69 64 0d 48 69 | 6c 69 74 65 53 63 72 6f | void.Hi|liteScro|
|00002180| 6c 6c 20 28 44 6f 63 48 | 61 6e 64 6c 65 20 64 6f |ll (DocH|andle do|
|00002190| 63 29 0d 7b 0d 57 69 6e | 64 6f 77 50 74 72 09 77 |c).{.Win|dowPtr.w|
|000021a0| 3b 0d 43 6f 6e 74 72 6f | 6c 48 61 6e 64 6c 65 09 |;.Contro|lHandle.|
|000021b0| 73 63 72 6f 6c 6c 3b 0d | 73 68 6f 72 74 09 68 69 |scroll;.|short.hi|
|000021c0| 6c 69 74 65 3b 0d 0d 09 | 77 20 3d 20 44 6f 63 57 |lite;...|w = DocW|
|000021d0| 69 6e 64 20 28 64 6f 63 | 29 3b 0d 09 73 63 72 6f |ind (doc|);..scro|
|000021e0| 6c 6c 20 3d 20 44 6f 63 | 53 63 72 6f 6c 6c 20 28 |ll = Doc|Scroll (|
|000021f0| 64 6f 63 29 3b 0d 09 68 | 69 6c 69 74 65 20 3d 20 |doc);..h|ilite = |
|00002200| 28 57 69 6e 64 6f 77 49 | 73 41 63 74 69 76 65 20 |(WindowI|sActive |
|00002210| 28 77 29 20 26 26 20 47 | 65 74 43 74 6c 4d 61 78 |(w) && G|etCtlMax|
|00002220| 20 28 73 63 72 6f 6c 6c | 29 20 3e 20 30 0d 09 09 | (scroll|) > 0...|
|00002230| 09 09 3f 20 6e 6f 72 6d | 61 6c 48 69 6c 69 74 65 |..? norm|alHilite|
|00002240| 20 3a 20 64 69 6d 48 69 | 6c 69 74 65 29 3b 0d 09 | : dimHi|lite);..|
|00002250| 48 69 6c 69 74 65 43 6f | 6e 74 72 6f 6c 20 28 73 |HiliteCo|ntrol (s|
|00002260| 63 72 6f 6c 6c 2c 20 68 | 69 6c 69 74 65 29 3b 0d |croll, h|ilite);.|
|00002270| 7d 0d 0d 0d 2f 2a 0d 20 | 2a 20 53 65 74 20 73 63 |}.../*. |* Set sc|
|00002280| 72 6f 6c 6c 20 62 61 72 | 20 63 75 72 72 65 6e 74 |roll bar| current|
|00002290| 20 76 61 6c 75 65 20 28 | 62 75 74 20 6f 6e 6c 79 | value (|but only|
|000022a0| 20 69 66 20 69 74 27 73 | 20 64 69 66 66 65 72 65 | if it's| differe|
|000022b0| 6e 74 20 74 68 61 6e 0d | 20 2a 20 74 68 65 20 63 |nt than.| * the c|
|000022c0| 75 72 72 65 6e 74 20 76 | 61 6c 75 65 2c 20 74 6f |urrent v|alue, to|
|000022d0| 20 61 76 6f 69 64 20 6e | 65 65 64 6c 65 73 73 20 | avoid n|eedless |
|000022e0| 66 6c 61 73 68 69 6e 67 | 29 2e 0d 20 2a 2f 0d 0d |flashing|).. */..|
|000022f0| 73 74 61 74 69 63 20 76 | 6f 69 64 0d 53 65 74 53 |static v|oid.SetS|
|00002300| 63 72 6f 6c 6c 56 61 6c | 75 65 20 28 43 6f 6e 74 |crollVal|ue (Cont|
|00002310| 72 6f 6c 48 61 6e 64 6c | 65 20 73 63 72 6f 6c 6c |rolHandl|e scroll|
|00002320| 2c 20 73 68 6f 72 74 20 | 76 61 6c 75 65 29 0d 7b |, short |value).{|
|00002330| 0d 09 69 66 20 28 47 65 | 74 43 74 6c 56 61 6c 75 |..if (Ge|tCtlValu|
|00002340| 65 20 28 73 63 72 6f 6c | 6c 29 20 21 3d 20 76 61 |e (scrol|l) != va|
|00002350| 6c 75 65 29 0d 09 09 53 | 65 74 43 74 6c 56 61 6c |lue)...S|etCtlVal|
|00002360| 75 65 20 28 73 63 72 6f | 6c 6c 2c 20 76 61 6c 75 |ue (scro|ll, valu|
|00002370| 65 29 3b 0d 7d 0d 0d 0d | 2f 2a 0d 20 2a 20 53 63 |e);.}...|/*. * Sc|
|00002380| 72 6f 6c 6c 20 74 6f 20 | 74 68 65 20 63 6f 72 72 |roll to |the corr|
|00002390| 65 63 74 20 70 6f 73 69 | 74 69 6f 6e 2e 20 20 6c |ect posi|tion. l|
|000023a0| 44 65 6c 74 61 20 69 73 | 20 74 68 65 0d 20 2a 20 |Delta is| the. * |
|000023b0| 61 6d 6f 75 6e 74 20 74 | 6f 20 43 48 41 4e 47 45 |amount t|o CHANGE|
|000023c0| 20 74 68 65 20 63 75 72 | 72 65 6e 74 20 73 63 72 | the cur|rent scr|
|000023d0| 6f 6c 6c 20 73 65 74 74 | 69 6e 67 20 62 79 2e 0d |oll sett|ing by..|
|000023e0| 20 2a 20 50 6f 73 69 74 | 69 76 65 20 73 63 72 6f | * Posit|ive scro|
|000023f0| 6c 6c 73 20 74 68 65 20 | 74 65 78 74 20 75 70 2c |lls the |text up,|
|00002400| 20 6e 65 67 61 74 69 76 | 65 20 64 6f 77 6e 2e 0d | negativ|e down..|
|00002410| 20 2a 2f 0d 0d 73 74 61 | 74 69 63 20 76 6f 69 64 | */..sta|tic void|
|00002420| 0d 53 63 72 6f 6c 6c 54 | 65 78 74 20 28 44 6f 63 |.ScrollT|ext (Doc|
|00002430| 48 61 6e 64 6c 65 20 64 | 6f 63 2c 20 73 68 6f 72 |Handle d|oc, shor|
|00002440| 74 20 6c 44 65 6c 74 61 | 29 0d 7b 0d 43 6f 6e 74 |t lDelta|).{.Cont|
|00002450| 72 6f 6c 48 61 6e 64 6c | 65 09 73 63 72 6f 6c 6c |rolHandl|e.scroll|
|00002460| 3b 0d 54 45 48 61 6e 64 | 6c 65 09 68 54 45 3b 0d |;.TEHand|le.hTE;.|
|00002470| 73 68 6f 72 74 09 74 6f | 70 56 69 73 4c 69 6e 65 |short.to|pVisLine|
|00002480| 3b 0d 73 68 6f 72 74 09 | 6e 65 77 54 6f 70 56 69 |;.short.|newTopVi|
|00002490| 73 4c 69 6e 65 3b 0d 0d | 09 73 63 72 6f 6c 6c 20 |sLine;..|.scroll |
|000024a0| 3d 20 44 6f 63 53 63 72 | 6f 6c 6c 20 28 64 6f 63 |= DocScr|oll (doc|
|000024b0| 29 3b 0d 09 68 54 45 20 | 3d 20 44 6f 63 54 45 20 |);..hTE |= DocTE |
|000024c0| 28 64 6f 63 29 3b 0d 0d | 09 74 6f 70 56 69 73 4c |(doc);..|.topVisL|
|000024d0| 69 6e 65 20 3d 20 4c 69 | 6e 65 73 4f 66 66 54 6f |ine = Li|nesOffTo|
|000024e0| 70 20 28 68 54 45 29 3b | 0d 20 20 20 20 6e 65 77 |p (hTE);|. new|
|000024f0| 54 6f 70 56 69 73 4c 69 | 6e 65 20 3d 20 74 6f 70 |TopVisLi|ne = top|
|00002500| 56 69 73 4c 69 6e 65 20 | 2b 20 6c 44 65 6c 74 61 |VisLine |+ lDelta|
|00002510| 3b 0d 20 20 20 20 69 66 | 20 28 6e 65 77 54 6f 70 |;. if| (newTop|
|00002520| 56 69 73 4c 69 6e 65 20 | 3c 20 30 29 09 09 09 09 |VisLine |< 0)....|
|00002530| 09 2f 2a 20 63 6c 69 70 | 20 74 6f 20 72 61 6e 67 |./* clip| to rang|
|00002540| 65 20 2a 2f 0d 20 20 20 | 20 09 6e 65 77 54 6f 70 |e */. | .newTop|
|00002550| 56 69 73 4c 69 6e 65 20 | 3d 20 30 3b 0d 20 20 20 |VisLine |= 0;. |
|00002560| 20 69 66 20 28 6e 65 77 | 54 6f 70 56 69 73 4c 69 | if (new|TopVisLi|
|00002570| 6e 65 20 3e 20 47 65 74 | 43 74 6c 4d 61 78 20 28 |ne > Get|CtlMax (|
|00002580| 73 63 72 6f 6c 6c 29 29 | 0d 09 09 6e 65 77 54 6f |scroll))|...newTo|
|00002590| 70 56 69 73 4c 69 6e 65 | 20 3d 20 47 65 74 43 74 |pVisLine| = GetCt|
|000025a0| 6c 4d 61 78 20 28 73 63 | 72 6f 6c 6c 29 3b 0d 20 |lMax (sc|roll);. |
|000025b0| 20 20 20 53 65 74 53 63 | 72 6f 6c 6c 56 61 6c 75 | SetSc|rollValu|
|000025c0| 65 20 28 73 63 72 6f 6c | 6c 2c 20 6e 65 77 54 6f |e (scrol|l, newTo|
|000025d0| 70 56 69 73 4c 69 6e 65 | 29 3b 0d 20 20 20 20 54 |pVisLine|);. T|
|000025e0| 45 53 63 72 6f 6c 6c 20 | 28 30 2c 20 28 74 6f 70 |EScroll |(0, (top|
|000025f0| 56 69 73 4c 69 6e 65 20 | 2d 20 6e 65 77 54 6f 70 |VisLine |- newTop|
|00002600| 56 69 73 4c 69 6e 65 20 | 29 20 2a 20 28 2a 2a 68 |VisLine |) * (**h|
|00002610| 54 45 29 2e 6c 69 6e 65 | 48 65 69 67 68 74 2c 20 |TE).line|Height, |
|00002620| 68 54 45 29 3b 0d 7d 0d | 0d 0d 2f 2a 0d 20 2a 20 |hTE);.}.|../*. * |
|00002630| 46 69 6c 74 65 72 20 70 | 72 6f 63 20 66 6f 72 20 |Filter p|roc for |
|00002640| 74 72 61 63 6b 69 6e 67 | 20 6d 6f 75 73 65 64 6f |tracking| mousedo|
|00002650| 77 6e 20 69 6e 20 73 63 | 72 6f 6c 6c 20 62 61 72 |wn in sc|roll bar|
|00002660| 2e 0d 20 2a 0d 20 2a 20 | 53 63 72 6f 6c 6c 20 62 |.. *. * |Scroll b|
|00002670| 79 20 6f 6e 65 20 6c 69 | 6e 65 20 69 66 20 74 68 |y one li|ne if th|
|00002680| 65 20 6d 6f 75 73 65 20 | 69 73 20 69 6e 20 61 6e |e mouse |is in an|
|00002690| 20 61 72 72 6f 77 2e 20 | 20 53 63 72 6f 6c 6c 20 | arrow. | Scroll |
|000026a0| 62 79 20 61 20 68 61 6c | 66 0d 20 2a 20 77 69 6e |by a hal|f. * win|
|000026b0| 64 6f 77 27 73 20 77 6f | 72 74 68 20 6f 66 20 6c |dow's wo|rth of l|
|000026c0| 69 6e 65 73 20 69 66 20 | 74 68 65 20 6d 6f 75 73 |ines if |the mous|
|000026d0| 65 20 69 73 20 69 6e 20 | 61 20 70 61 67 65 20 72 |e is in |a page r|
|000026e0| 65 67 69 6f 6e 2e 0d 20 | 2a 0d 20 2a 20 54 72 61 |egion.. |*. * Tra|
|000026f0| 63 6b 53 63 72 6f 6c 6c | 28 29 20 75 73 65 73 20 |ckScroll|() uses |
|00002700| 73 63 72 6f 6c 6c 44 6f | 63 20 61 6e 64 20 73 63 |scrollDo|c and sc|
|00002710| 72 6f 6c 6c 50 61 72 74 | 2c 20 77 68 69 63 68 20 |rollPart|, which |
|00002720| 6d 75 73 74 20 62 65 20 | 73 65 74 20 69 6e 0d 20 |must be |set in. |
|00002730| 2a 20 4d 6f 75 73 65 28 | 29 20 62 65 66 6f 72 65 |* Mouse(|) before|
|00002740| 20 63 61 6c 6c 69 6e 67 | 20 54 72 61 63 6b 43 6f | calling| TrackCo|
|00002750| 6e 74 72 6f 6c 28 29 2c | 20 77 68 69 63 68 20 63 |ntrol(),| which c|
|00002760| 61 6c 6c 73 20 54 72 61 | 63 6b 53 63 72 6f 6c 6c |alls Tra|ckScroll|
|00002770| 28 29 2e 0d 20 2a 20 73 | 63 72 6f 6c 6c 50 61 72 |().. * s|crollPar|
|00002780| 74 20 69 73 20 74 68 65 | 20 6f 72 69 67 69 6e 61 |t is the| origina|
|00002790| 6c 20 70 61 72 74 20 63 | 6f 64 65 20 69 6e 20 77 |l part c|ode in w|
|000027a0| 68 69 63 68 20 74 68 65 | 20 6d 6f 75 73 65 64 6f |hich the| mousedo|
|000027b0| 77 6e 20 6f 63 63 75 72 | 72 65 64 2e 0d 20 2a 2f |wn occur|red.. */|
|000027c0| 0d 0d 73 74 61 74 69 63 | 20 44 6f 63 48 61 6e 64 |..static| DocHand|
|000027d0| 6c 65 09 73 63 72 6f 6c | 6c 44 6f 63 3b 0d 73 74 |le.scrol|lDoc;.st|
|000027e0| 61 74 69 63 20 73 68 6f | 72 74 09 09 73 63 72 6f |atic sho|rt..scro|
|000027f0| 6c 6c 50 61 72 74 3b 0d | 0d 73 74 61 74 69 63 20 |llPart;.|.static |
|00002800| 70 61 73 63 61 6c 20 76 | 6f 69 64 0d 54 72 61 63 |pascal v|oid.Trac|
|00002810| 6b 53 63 72 6f 6c 6c 20 | 28 43 6f 6e 74 72 6f 6c |kScroll |(Control|
|00002820| 48 61 6e 64 6c 65 20 74 | 68 65 53 63 72 6f 6c 6c |Handle t|heScroll|
|00002830| 2c 20 73 68 6f 72 74 20 | 70 61 72 74 43 6f 64 65 |, short |partCode|
|00002840| 29 0d 7b 0d 54 45 48 61 | 6e 64 6c 65 09 68 54 45 |).{.TEHa|ndle.hTE|
|00002850| 3b 0d 73 68 6f 72 74 09 | 6c 44 65 6c 74 61 3b 0d |;.short.|lDelta;.|
|00002860| 73 68 6f 72 74 09 68 61 | 6c 66 50 61 67 65 3b 0d |short.ha|lfPage;.|
|00002870| 0d 09 68 54 45 20 3d 20 | 44 6f 63 54 45 20 28 73 |..hTE = |DocTE (s|
|00002880| 63 72 6f 6c 6c 44 6f 63 | 29 3b 0d 09 69 66 20 28 |crollDoc|);..if (|
|00002890| 70 61 72 74 43 6f 64 65 | 20 3d 3d 20 73 63 72 6f |partCode| == scro|
|000028a0| 6c 6c 50 61 72 74 29 09 | 09 09 2f 2a 20 73 74 69 |llPart).|../* sti|
|000028b0| 6c 6c 20 69 6e 20 73 61 | 6d 65 20 70 61 72 74 3f |ll in sa|me part?|
|000028c0| 20 2a 2f 0d 09 7b 0d 09 | 09 68 61 6c 66 50 61 67 | */..{..|.halfPag|
|000028d0| 65 20 3d 20 28 28 28 2a | 2a 68 54 45 29 2e 76 69 |e = (((*|*hTE).vi|
|000028e0| 65 77 52 65 63 74 2e 62 | 6f 74 74 6f 6d 20 2d 20 |ewRect.b|ottom - |
|000028f0| 28 2a 2a 68 54 45 29 2e | 76 69 65 77 52 65 63 74 |(**hTE).|viewRect|
|00002900| 2e 74 6f 70 29 0d 09 09 | 09 09 09 09 2f 20 28 2a |.top)...|..../ (*|
|00002910| 2a 68 54 45 29 2e 6c 69 | 6e 65 48 65 69 67 68 74 |*hTE).li|neHeight|
|00002920| 29 20 2f 20 32 3b 0d 09 | 09 69 66 20 28 68 61 6c |) / 2;..|.if (hal|
|00002930| 66 50 61 67 65 20 3d 3d | 20 30 29 0d 09 09 09 2b |fPage ==| 0)....+|
|00002940| 2b 68 61 6c 66 50 61 67 | 65 3b 0d 09 09 73 77 69 |+halfPag|e;...swi|
|00002950| 74 63 68 20 28 70 61 72 | 74 43 6f 64 65 29 0d 09 |tch (par|tCode)..|
|00002960| 09 7b 0d 09 09 09 63 61 | 73 65 20 69 6e 55 70 42 |.{....ca|se inUpB|
|00002970| 75 74 74 6f 6e 3a 20 6c | 44 65 6c 74 61 20 3d 20 |utton: l|Delta = |
|00002980| 2d 31 3b 20 62 72 65 61 | 6b 3b 0d 09 09 09 63 61 |-1; brea|k;....ca|
|00002990| 73 65 20 69 6e 44 6f 77 | 6e 42 75 74 74 6f 6e 3a |se inDow|nButton:|
|000029a0| 20 6c 44 65 6c 74 61 20 | 3d 20 31 3b 20 62 72 65 | lDelta |= 1; bre|
|000029b0| 61 6b 3b 0d 09 09 09 63 | 61 73 65 20 69 6e 50 61 |ak;....c|ase inPa|
|000029c0| 67 65 55 70 3a 20 6c 44 | 65 6c 74 61 20 3d 20 2d |geUp: lD|elta = -|
|000029d0| 68 61 6c 66 50 61 67 65 | 3b 20 62 72 65 61 6b 3b |halfPage|; break;|
|000029e0| 0d 09 09 09 63 61 73 65 | 20 69 6e 50 61 67 65 44 |....case| inPageD|
|000029f0| 6f 77 6e 3a 20 6c 44 65 | 6c 74 61 20 3d 20 68 61 |own: lDe|lta = ha|
|00002a00| 6c 66 50 61 67 65 3b 20 | 62 72 65 61 6b 3b 0d 09 |lfPage; |break;..|
|00002a10| 09 7d 0d 09 09 53 63 72 | 6f 6c 6c 54 65 78 74 20 |.}...Scr|ollText |
|00002a20| 28 73 63 72 6f 6c 6c 44 | 6f 63 2c 20 6c 44 65 6c |(scrollD|oc, lDel|
|00002a30| 74 61 29 3b 0d 09 7d 0d | 7d 0d 0d 0d 2f 2a 0d 20 |ta);..}.|}.../*. |
|00002a40| 2a 20 4f 76 65 72 68 61 | 75 6c 20 74 68 65 20 65 |* Overha|ul the e|
|00002a50| 6e 74 69 72 65 20 64 69 | 73 70 6c 61 79 2e 20 20 |ntire di|splay. |
|00002a60| 54 68 69 73 20 69 73 20 | 63 61 6c 6c 65 64 20 61 |This is |called a|
|00002a70| 66 74 65 72 20 63 61 74 | 61 73 74 72 6f 70 68 69 |fter cat|astrophi|
|00002a80| 63 0d 20 2a 20 65 76 65 | 6e 74 73 2c 20 73 75 63 |c. * eve|nts, suc|
|00002a90| 68 20 61 73 20 72 65 73 | 69 7a 69 6e 67 20 74 68 |h as res|izing th|
|00002aa0| 65 20 77 69 6e 64 6f 77 | 2c 20 6f 72 20 63 68 61 |e window|, or cha|
|00002ab0| 6e 67 65 73 20 74 6f 20 | 74 68 65 20 77 6f 72 64 |nges to |the word|
|00002ac0| 0d 20 2a 20 77 72 61 70 | 20 73 74 79 6c 65 2e 20 |. * wrap| style. |
|00002ad0| 20 49 74 20 6d 61 6b 65 | 73 20 73 75 72 65 20 74 | It make|s sure t|
|00002ae0| 68 65 20 76 69 65 77 20 | 61 6e 64 20 64 65 73 74 |he view |and dest|
|00002af0| 69 6e 61 74 69 6f 6e 20 | 72 65 63 74 61 6e 67 6c |ination |rectangl|
|00002b00| 65 73 0d 20 2a 20 61 72 | 65 20 73 69 7a 65 64 20 |es. * ar|e sized |
|00002b10| 70 72 6f 70 65 72 6c 79 | 2c 20 61 6e 64 20 74 68 |properly|, and th|
|00002b20| 61 74 20 74 68 65 20 62 | 6f 74 74 6f 6d 20 6c 69 |at the b|ottom li|
|00002b30| 6e 65 20 6f 66 20 74 65 | 78 74 20 6e 65 76 65 72 |ne of te|xt never|
|00002b40| 0d 20 2a 20 73 63 72 6f | 6c 6c 73 20 75 70 20 70 |. * scro|lls up p|
|00002b50| 61 73 74 20 74 68 65 20 | 62 6f 74 74 6f 6d 20 6c |ast the |bottom l|
|00002b60| 69 6e 65 20 6f 66 20 74 | 68 65 20 77 69 6e 64 6f |ine of t|he windo|
|00002b70| 77 20 28 69 66 20 74 68 | 65 72 65 27 73 0d 20 2a |w (if th|ere's. *|
|00002b80| 20 65 6e 6f 75 67 68 20 | 74 6f 20 66 69 6c 6c 20 | enough |to fill |
|00002b90| 74 68 65 20 77 69 6e 64 | 6f 77 29 2c 20 61 6e 64 |the wind|ow), and|
|00002ba0| 20 74 68 61 74 20 74 68 | 65 20 73 63 72 6f 6c 6c | that th|e scroll|
|00002bb0| 20 62 61 72 20 6d 61 78 | 20 61 6e 64 0d 20 2a 20 | bar max| and. * |
|00002bc0| 63 75 72 72 65 6e 74 20 | 76 61 6c 75 65 73 20 61 |current |values a|
|00002bd0| 72 65 20 73 65 74 20 70 | 72 6f 70 65 72 6c 79 2e |re set p|roperly.|
|00002be0| 0d 20 2a 0d 20 2a 20 52 | 65 73 69 7a 69 6e 67 20 |. *. * R|esizing |
|00002bf0| 74 68 65 20 64 65 73 74 | 20 72 65 63 74 20 6a 75 |the dest| rect ju|
|00002c00| 73 74 20 6d 65 61 6e 73 | 20 72 65 73 65 74 74 69 |st means| resetti|
|00002c10| 6e 67 20 74 68 65 20 72 | 69 67 68 74 20 65 64 67 |ng the r|ight edg|
|00002c20| 65 0d 20 2a 20 28 74 68 | 65 20 74 6f 70 20 69 73 |e. * (th|e top is|
|00002c30| 20 4e 4f 54 20 72 65 73 | 65 74 29 2c 20 73 69 6e | NOT res|et), sin|
|00002c40| 63 65 20 74 65 78 74 20 | 6d 69 67 68 74 20 62 65 |ce text |might be|
|00002c50| 20 73 63 72 6f 6c 6c 65 | 64 20 6f 66 66 20 74 68 | scrolle|d off th|
|00002c60| 65 0d 20 2a 20 74 6f 70 | 20 28 69 2e 65 2e 2c 20 |e. * top| (i.e., |
|00002c70| 64 65 73 74 52 65 63 74 | 2e 74 6f 70 20 21 3d 20 |destRect|.top != |
|00002c80| 30 29 2e 0d 20 2a 2f 0d | 0d 73 74 61 74 69 63 20 |0).. */.|.static |
|00002c90| 76 6f 69 64 0d 4f 76 65 | 72 68 61 75 6c 44 69 73 |void.Ove|rhaulDis|
|00002ca0| 70 6c 61 79 20 28 44 6f | 63 48 61 6e 64 6c 65 20 |play (Do|cHandle |
|00002cb0| 64 6f 63 29 0d 7b 0d 57 | 69 6e 64 6f 77 50 74 72 |doc).{.W|indowPtr|
|00002cc0| 09 77 3b 0d 54 45 48 61 | 6e 64 6c 65 09 68 54 45 |.w;.TEHa|ndle.hTE|
|00002cd0| 3b 0d 43 6f 6e 74 72 6f | 6c 48 61 6e 64 6c 65 09 |;.Contro|lHandle.|
|00002ce0| 73 63 72 6f 6c 6c 3b 0d | 52 65 63 74 09 72 3b 0d |scroll;.|Rect.r;.|
|00002cf0| 73 68 6f 72 74 09 6e 4c | 69 6e 65 73 3b 09 09 09 |short.nL|ines;...|
|00002d00| 2f 2a 20 23 20 6f 66 20 | 6c 69 6e 65 73 20 69 6e |/* # of |lines in|
|00002d10| 20 54 45 52 65 63 20 2a | 2f 0d 73 68 6f 72 74 09 | TERec *|/.short.|
|00002d20| 76 69 73 4c 69 6e 65 73 | 3b 09 09 2f 2a 20 23 20 |visLines|;../* # |
|00002d30| 6f 66 20 6c 69 6e 65 73 | 20 64 69 73 70 6c 61 79 |of lines| display|
|00002d40| 61 62 6c 65 20 69 6e 20 | 77 69 6e 64 6f 77 20 2a |able in |window *|
|00002d50| 2f 0d 73 68 6f 72 74 09 | 74 6f 70 4c 69 6e 65 73 |/.short.|topLines|
|00002d60| 3b 09 09 2f 2a 20 23 20 | 6f 66 20 6c 69 6e 65 73 |;../* # |of lines|
|00002d70| 20 63 75 72 72 65 6e 74 | 6c 79 20 73 63 72 6f 6c | current|ly scrol|
|00002d80| 6c 65 64 20 6f 66 66 20 | 74 6f 70 20 2a 2f 0d 73 |led off |top */.s|
|00002d90| 68 6f 72 74 09 73 63 72 | 6f 6c 6c 4c 69 6e 65 73 |hort.scr|ollLines|
|00002da0| 3b 09 2f 2a 20 23 20 6f | 66 20 6c 69 6e 65 73 20 |;./* # o|f lines |
|00002db0| 74 6f 20 73 63 72 6f 6c | 6c 20 64 6f 77 6e 20 2a |to scrol|l down *|
|00002dc0| 2f 0d 73 68 6f 72 74 09 | 6c 48 65 69 67 68 74 3b |/.short.|lHeight;|
|00002dd0| 0d 0d 09 77 20 3d 20 44 | 6f 63 57 69 6e 64 20 28 |...w = D|ocWind (|
|00002de0| 64 6f 63 29 3b 0d 09 68 | 54 45 20 3d 20 44 6f 63 |doc);..h|TE = Doc|
|00002df0| 54 45 20 28 64 6f 63 29 | 3b 0d 09 73 63 72 6f 6c |TE (doc)|;..scrol|
|00002e00| 6c 20 3d 20 44 6f 63 53 | 63 72 6f 6c 6c 20 28 64 |l = DocS|croll (d|
|00002e10| 6f 63 29 3b 0d 09 43 61 | 6c 63 45 64 69 74 52 65 |oc);..Ca|lcEditRe|
|00002e20| 63 74 20 28 77 2c 20 26 | 72 29 3b 0d 09 28 2a 2a |ct (w, &|r);..(**|
|00002e30| 68 54 45 29 2e 64 65 73 | 74 52 65 63 74 2e 72 69 |hTE).des|tRect.ri|
|00002e40| 67 68 74 20 3d 20 72 2e | 72 69 67 68 74 3b 0d 09 |ght = r.|right;..|
|00002e50| 28 2a 2a 68 54 45 29 2e | 76 69 65 77 52 65 63 74 |(**hTE).|viewRect|
|00002e60| 20 3d 20 72 3b 0d 09 54 | 45 43 61 6c 54 65 78 74 | = r;..T|ECalText|
|00002e70| 20 28 68 54 45 29 3b 09 | 09 2f 2a 20 72 65 63 61 | (hTE);.|./* reca|
|00002e80| 6c 63 20 6c 69 6e 65 20 | 73 74 61 72 74 73 20 2a |lc line |starts *|
|00002e90| 2f 0d 09 6c 48 65 69 67 | 68 74 20 3d 20 28 2a 2a |/..lHeig|ht = (**|
|00002ea0| 68 54 45 29 2e 6c 69 6e | 65 48 65 69 67 68 74 3b |hTE).lin|eHeight;|
|00002eb0| 0d 09 6e 4c 69 6e 65 73 | 20 3d 20 28 2a 2a 68 54 |..nLines| = (**hT|
|00002ec0| 45 29 2e 6e 4c 69 6e 65 | 73 3b 0d 09 76 69 73 4c |E).nLine|s;..visL|
|00002ed0| 69 6e 65 73 20 3d 20 28 | 72 2e 62 6f 74 74 6f 6d |ines = (|r.bottom|
|00002ee0| 20 2d 20 72 2e 74 6f 70 | 29 20 2f 20 6c 48 65 69 | - r.top|) / lHei|
|00002ef0| 67 68 74 3b 0d 09 74 6f | 70 4c 69 6e 65 73 20 3d |ght;..to|pLines =|
|00002f00| 20 4c 69 6e 65 73 4f 66 | 66 54 6f 70 20 28 68 54 | LinesOf|fTop (hT|
|00002f10| 45 29 3b 0d 0d 09 2f 2a | 0d 09 20 2a 20 49 66 20 |E);.../*|.. * If |
|00002f20| 74 68 65 20 74 65 78 74 | 20 64 6f 65 73 6e 27 74 |the text| doesn't|
|00002f30| 20 66 69 6c 6c 20 74 68 | 65 20 77 69 6e 64 6f 77 | fill th|e window|
|00002f40| 20 28 76 69 73 4c 69 6e | 65 73 20 3e 20 6e 4c 69 | (visLin|es > nLi|
|00002f50| 6e 65 73 20 2d 20 74 6f | 70 4c 69 6e 65 73 29 2c |nes - to|pLines),|
|00002f60| 0d 09 20 2a 20 70 75 6c | 6c 20 74 68 65 20 74 65 |.. * pul|l the te|
|00002f70| 78 74 20 64 6f 77 6e 20 | 69 66 20 70 6f 73 73 69 |xt down |if possi|
|00002f80| 62 6c 65 20 28 69 66 20 | 74 6f 70 4c 69 6e 65 73 |ble (if |topLines|
|00002f90| 20 3e 20 30 29 2e 20 20 | 4d 61 6b 65 20 73 75 72 | > 0). |Make sur|
|00002fa0| 65 20 6e 6f 74 0d 09 20 | 2a 20 74 6f 20 74 72 79 |e not.. |* to try|
|00002fb0| 20 74 6f 20 73 63 72 6f | 6c 6c 20 64 6f 77 6e 20 | to scro|ll down |
|00002fc0| 62 79 20 6d 6f 72 65 20 | 6c 69 6e 65 73 20 74 68 |by more |lines th|
|00002fd0| 61 6e 20 61 72 65 20 68 | 69 64 64 65 6e 20 6f 66 |an are h|idden of|
|00002fe0| 66 20 74 68 65 20 74 6f | 70 2e 0d 09 20 2a 2f 0d |f the to|p... */.|
|00002ff0| 09 73 63 72 6f 6c 6c 4c | 69 6e 65 73 20 3d 20 76 |.scrollL|ines = v|
|00003000| 69 73 4c 69 6e 65 73 20 | 2d 20 28 6e 4c 69 6e 65 |isLines |- (nLine|
|00003010| 73 20 2d 20 74 6f 70 4c | 69 6e 65 73 29 3b 0d 09 |s - topL|ines);..|
|00003020| 69 66 20 28 73 63 72 6f | 6c 6c 4c 69 6e 65 73 20 |if (scro|llLines |
|00003030| 3e 20 30 20 26 26 20 74 | 6f 70 4c 69 6e 65 73 20 |> 0 && t|opLines |
|00003040| 3e 20 30 29 0d 09 7b 0d | 09 09 69 66 20 28 73 63 |> 0)..{.|..if (sc|
|00003050| 72 6f 6c 6c 4c 69 6e 65 | 73 20 3e 20 74 6f 70 4c |rollLine|s > topL|
|00003060| 69 6e 65 73 29 0d 09 09 | 09 73 63 72 6f 6c 6c 4c |ines)...|.scrollL|
|00003070| 69 6e 65 73 20 3d 20 74 | 6f 70 4c 69 6e 65 73 3b |ines = t|opLines;|
|00003080| 0d 09 09 54 45 53 63 72 | 6f 6c 6c 20 28 30 2c 20 |...TEScr|oll (0, |
|00003090| 73 63 72 6f 6c 6c 4c 69 | 6e 65 73 20 2a 20 6c 48 |scrollLi|nes * lH|
|000030a0| 65 69 67 68 74 2c 20 68 | 54 45 29 3b 0d 09 09 74 |eight, h|TE);...t|
|000030b0| 6f 70 4c 69 6e 65 73 20 | 2d 3d 20 73 63 72 6f 6c |opLines |-= scrol|
|000030c0| 6c 4c 69 6e 65 73 3b 0d | 09 7d 0d 09 54 45 55 70 |lLines;.|.}..TEUp|
|000030d0| 64 61 74 65 20 28 26 72 | 2c 20 68 54 45 29 3b 0d |date (&r|, hTE);.|
|000030e0| 0d 09 53 65 74 43 74 6c | 4d 61 78 20 28 73 63 72 |..SetCtl|Max (scr|
|000030f0| 6f 6c 6c 2c 20 6e 4c 69 | 6e 65 73 20 2d 20 76 69 |oll, nLi|nes - vi|
|00003100| 73 4c 69 6e 65 73 20 3c | 20 30 20 3f 20 30 20 3a |sLines <| 0 ? 0 :|
|00003110| 20 6e 4c 69 6e 65 73 20 | 2d 20 76 69 73 4c 69 6e | nLines |- visLin|
|00003120| 65 73 29 3b 0d 09 53 65 | 74 43 74 6c 56 61 6c 75 |es);..Se|tCtlValu|
|00003130| 65 20 28 73 63 72 6f 6c | 6c 2c 20 74 6f 70 4c 69 |e (scrol|l, topLi|
|00003140| 6e 65 73 29 3b 0d 09 48 | 69 6c 69 74 65 53 63 72 |nes);..H|iliteScr|
|00003150| 6f 6c 6c 20 28 64 6f 63 | 29 3b 0d 7d 0d 0d 0d 2f |oll (doc|);.}.../|
|00003160| 2a 20 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |* ------|--------|
|00003170| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00003180| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00003190| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000031a0| 2d 2d 20 2a 2f 0d 2f 2a | 09 09 09 09 09 09 57 69 |-- */./*|......Wi|
|000031b0| 6e 64 6f 77 20 48 61 6e | 64 6c 65 72 20 52 6f 75 |ndow Han|dler Rou|
|000031c0| 74 69 6e 65 73 09 09 09 | 09 09 09 2a 2f 0d 2f 2a |tines...|...*/./*|
|000031d0| 20 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d | -------|--------|
|000031e0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000031f0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00003200| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00003210| 2d 20 2a 2f 0d 0d 0d 2f | 2a 0d 20 2a 20 48 61 6e |- */.../|*. * Han|
|00003220| 64 6c 65 20 6d 6f 75 73 | 65 20 63 6c 69 63 6b 73 |dle mous|e clicks|
|00003230| 20 69 6e 20 77 69 6e 64 | 6f 77 0d 20 2a 2f 0d 0d | in wind|ow. */..|
|00003240| 73 74 61 74 69 63 20 70 | 61 73 63 61 6c 20 76 6f |static p|ascal vo|
|00003250| 69 64 0d 4d 6f 75 73 65 | 20 28 50 6f 69 6e 74 20 |id.Mouse| (Point |
|00003260| 74 68 65 50 74 2c 20 6c | 6f 6e 67 20 74 2c 20 73 |thePt, l|ong t, s|
|00003270| 68 6f 72 74 20 6d 6f 64 | 73 29 0d 7b 0d 57 69 6e |hort mod|s).{.Win|
|00003280| 64 6f 77 50 74 72 09 77 | 3b 0d 44 6f 63 48 61 6e |dowPtr.w|;.DocHan|
|00003290| 64 6c 65 09 64 6f 63 3b | 0d 43 6f 6e 74 72 6f 6c |dle.doc;|.Control|
|000032a0| 48 61 6e 64 6c 65 09 73 | 63 72 6f 6c 6c 3b 0d 73 |Handle.s|croll;.s|
|000032b0| 68 6f 72 74 09 74 68 65 | 50 61 72 74 3b 0d 73 68 |hort.the|Part;.sh|
|000032c0| 6f 72 74 09 6f 6c 64 43 | 74 6c 56 61 6c 75 65 3b |ort.oldC|tlValue;|
|000032d0| 0d 0d 09 47 65 74 50 6f | 72 74 20 28 26 77 29 3b |...GetPo|rt (&w);|
|000032e0| 0d 09 64 6f 63 20 3d 20 | 57 69 6e 64 44 6f 63 48 |..doc = |WindDocH|
|000032f0| 61 6e 64 6c 65 20 28 77 | 29 3b 0d 09 73 63 72 6f |andle (w|);..scro|
|00003300| 6c 6c 20 3d 20 44 6f 63 | 53 63 72 6f 6c 6c 20 28 |ll = Doc|Scroll (|
|00003310| 64 6f 63 29 3b 0d 0d 09 | 69 66 20 28 28 74 68 65 |doc);...|if ((the|
|00003320| 50 61 72 74 20 3d 20 54 | 65 73 74 43 6f 6e 74 72 |Part = T|estContr|
|00003330| 6f 6c 20 28 73 63 72 6f | 6c 6c 2c 20 74 68 65 50 |ol (scro|ll, theP|
|00003340| 74 29 29 20 3d 3d 20 69 | 6e 54 68 75 6d 62 29 0d |t)) == i|nThumb).|
|00003350| 09 7b 0d 09 09 6f 6c 64 | 43 74 6c 56 61 6c 75 65 |.{...old|CtlValue|
|00003360| 20 3d 20 47 65 74 43 74 | 6c 56 61 6c 75 65 20 28 | = GetCt|lValue (|
|00003370| 73 63 72 6f 6c 6c 29 3b | 0d 09 09 69 66 20 28 54 |scroll);|...if (T|
|00003380| 72 61 63 6b 43 6f 6e 74 | 72 6f 6c 20 28 73 63 72 |rackCont|rol (scr|
|00003390| 6f 6c 6c 2c 20 74 68 65 | 50 74 2c 20 6e 69 6c 29 |oll, the|Pt, nil)|
|000033a0| 20 3d 3d 20 69 6e 54 68 | 75 6d 62 29 0d 09 09 09 | == inTh|umb)....|
|000033b0| 53 63 72 6f 6c 6c 54 65 | 78 74 20 28 64 6f 63 2c |ScrollTe|xt (doc,|
|000033c0| 20 47 65 74 43 74 6c 56 | 61 6c 75 65 20 28 73 63 | GetCtlV|alue (sc|
|000033d0| 72 6f 6c 6c 29 20 2d 20 | 6f 6c 64 43 74 6c 56 61 |roll) - |oldCtlVa|
|000033e0| 6c 75 65 29 3b 0d 09 7d | 0d 09 65 6c 73 65 20 69 |lue);..}|..else i|
|000033f0| 66 20 28 74 68 65 50 61 | 72 74 20 21 3d 20 30 29 |f (thePa|rt != 0)|
|00003400| 0d 09 7b 0d 09 09 73 63 | 72 6f 6c 6c 44 6f 63 20 |..{...sc|rollDoc |
|00003410| 3d 20 64 6f 63 3b 09 09 | 2f 2a 20 73 65 74 20 67 |= doc;..|/* set g|
|00003420| 6c 6f 62 61 6c 73 20 66 | 6f 72 20 54 72 61 63 6b |lobals f|or Track|
|00003430| 53 63 72 6f 6c 6c 20 2a | 2f 0d 09 09 73 63 72 6f |Scroll *|/...scro|
|00003440| 6c 6c 50 61 72 74 20 3d | 20 74 68 65 50 61 72 74 |llPart =| thePart|
|00003450| 3b 0d 09 09 28 76 6f 69 | 64 29 20 54 72 61 63 6b |;...(voi|d) Track|
|00003460| 43 6f 6e 74 72 6f 6c 20 | 28 73 63 72 6f 6c 6c 2c |Control |(scroll,|
|00003470| 20 74 68 65 50 74 2c 20 | 26 54 72 61 63 6b 53 63 | thePt, |&TrackSc|
|00003480| 72 6f 6c 6c 29 3b 0d 09 | 7d 0d 7d 0d 0d 0d 2f 2a |roll);..|}.}.../*|
|00003490| 0d 20 2a 20 55 70 64 61 | 74 65 20 77 69 6e 64 6f |. * Upda|te windo|
|000034a0| 77 2e 20 20 54 68 65 20 | 75 70 64 61 74 65 20 65 |w. The |update e|
|000034b0| 76 65 6e 74 20 6d 69 67 | 68 74 20 62 65 20 69 6e |vent mig|ht be in|
|000034c0| 20 72 65 73 70 6f 6e 73 | 65 20 74 6f 20 61 0d 20 | respons|e to a. |
|000034d0| 2a 20 77 69 6e 64 6f 77 | 20 72 65 73 69 7a 69 6e |* window| resizin|
|000034e0| 67 2e 20 20 49 66 20 73 | 6f 2c 20 6d 6f 76 65 20 |g. If s|o, move |
|000034f0| 61 6e 64 20 72 65 73 69 | 7a 65 20 74 68 65 20 73 |and resi|ze the s|
|00003500| 63 72 6f 6c 6c 20 62 61 | 72 2c 0d 20 2a 20 61 6e |croll ba|r,. * an|
|00003510| 64 20 72 65 63 61 6c 63 | 75 6c 61 74 65 20 74 68 |d recalc|ulate th|
|00003520| 65 20 74 65 78 74 20 64 | 69 73 70 6c 61 79 2e 0d |e text d|isplay..|
|00003530| 20 2a 0d 20 2a 20 54 68 | 65 20 56 61 6c 69 64 52 | *. * Th|e ValidR|
|00003540| 65 63 74 20 63 61 6c 6c | 20 69 73 20 64 6f 6e 65 |ect call| is done|
|00003550| 20 62 65 63 61 75 73 65 | 20 74 68 65 20 48 69 64 | because| the Hid|
|00003560| 65 43 6f 6e 74 72 6f 6c | 20 61 64 64 73 20 74 68 |eControl| adds th|
|00003570| 65 0d 20 2a 20 63 6f 6e | 74 72 6f 6c 20 62 6f 75 |e. * con|trol bou|
|00003580| 6e 64 73 20 62 6f 78 20 | 74 6f 20 74 68 65 20 75 |nds box |to the u|
|00003590| 70 64 61 74 65 20 72 65 | 67 69 6f 6e 20 2d 20 77 |pdate re|gion - w|
|000035a0| 68 69 63 68 20 77 6f 75 | 6c 64 20 67 65 6e 65 72 |hich wou|ld gener|
|000035b0| 61 74 65 0d 20 2a 20 61 | 6e 6f 74 68 65 72 20 75 |ate. * a|nother u|
|000035c0| 70 64 61 74 65 20 65 76 | 65 6e 74 21 20 20 53 69 |pdate ev|ent! Si|
|000035d0| 6e 63 65 20 65 76 65 72 | 79 74 68 69 6e 67 20 69 |nce ever|ything i|
|000035e0| 73 20 72 65 64 72 61 77 | 6e 20 62 65 6c 6f 77 20 |s redraw|n below |
|000035f0| 61 6e 79 77 61 79 2c 0d | 20 2a 20 74 68 65 20 56 |anyway,.| * the V|
|00003600| 61 6c 69 64 52 65 63 74 | 20 69 73 20 75 73 65 64 |alidRect| is used|
|00003610| 20 74 6f 20 63 61 6e 63 | 65 6c 20 74 68 65 20 75 | to canc|el the u|
|00003620| 70 64 61 74 65 2e 0d 20 | 2a 2f 0d 0d 73 74 61 74 |pdate.. |*/..stat|
|00003630| 69 63 20 70 61 73 63 61 | 6c 20 76 6f 69 64 0d 55 |ic pasca|l void.U|
|00003640| 70 64 61 74 65 20 28 42 | 6f 6f 6c 65 61 6e 20 72 |pdate (B|oolean r|
|00003650| 65 73 69 7a 65 64 29 0d | 7b 0d 57 69 6e 64 6f 77 |esized).|{.Window|
|00003660| 50 74 72 09 77 3b 0d 44 | 6f 63 48 61 6e 64 6c 65 |Ptr.w;.D|ocHandle|
|00003670| 09 64 6f 63 3b 0d 43 6f | 6e 74 72 6f 6c 48 61 6e |.doc;.Co|ntrolHan|
|00003680| 64 6c 65 09 73 63 72 6f | 6c 6c 3b 0d 54 45 48 61 |dle.scro|ll;.TEHa|
|00003690| 6e 64 6c 65 09 68 54 45 | 3b 0d 52 65 63 74 09 72 |ndle.hTE|;.Rect.r|
|000036a0| 3b 0d 0d 09 47 65 74 50 | 6f 72 74 20 28 26 77 29 |;...GetP|ort (&w)|
|000036b0| 3b 0d 09 64 6f 63 20 3d | 20 57 69 6e 64 44 6f 63 |;..doc =| WindDoc|
|000036c0| 48 61 6e 64 6c 65 20 28 | 77 29 3b 0d 09 73 63 72 |Handle (|w);..scr|
|000036d0| 6f 6c 6c 20 3d 20 44 6f | 63 53 63 72 6f 6c 6c 20 |oll = Do|cScroll |
|000036e0| 28 64 6f 63 29 3b 0d 09 | 68 54 45 20 3d 20 44 6f |(doc);..|hTE = Do|
|000036f0| 63 54 45 20 28 64 6f 63 | 29 3b 0d 0d 09 69 66 20 |cTE (doc|);...if |
|00003700| 28 72 65 73 69 7a 65 64 | 29 0d 09 7b 0d 09 09 72 |(resized|)..{...r|
|00003710| 20 3d 20 77 2d 3e 70 6f | 72 74 52 65 63 74 3b 0d | = w->po|rtRect;.|
|00003720| 09 09 45 72 61 73 65 52 | 65 63 74 20 28 26 72 29 |..EraseR|ect (&r)|
|00003730| 3b 0d 09 09 48 69 64 65 | 43 6f 6e 74 72 6f 6c 20 |;...Hide|Control |
|00003740| 28 73 63 72 6f 6c 6c 29 | 3b 0d 09 09 72 20 3d 20 |(scroll)|;...r = |
|00003750| 28 2a 2a 73 63 72 6f 6c | 6c 29 2e 63 6f 6e 74 72 |(**scrol|l).contr|
|00003760| 6c 52 65 63 74 3b 0d 09 | 09 56 61 6c 69 64 52 65 |lRect;..|.ValidRe|
|00003770| 63 74 20 28 26 72 29 3b | 0d 09 09 43 61 6c 63 53 |ct (&r);|...CalcS|
|00003780| 63 72 6f 6c 6c 52 65 63 | 74 20 28 77 2c 20 26 72 |crollRec|t (w, &r|
|00003790| 29 3b 0d 09 09 53 69 7a | 65 43 6f 6e 74 72 6f 6c |);...Siz|eControl|
|000037a0| 20 28 73 63 72 6f 6c 6c | 2c 20 31 36 2c 20 72 2e | (scroll|, 16, r.|
|000037b0| 62 6f 74 74 6f 6d 20 2d | 20 72 2e 74 6f 70 29 3b |bottom -| r.top);|
|000037c0| 0d 09 09 4d 6f 76 65 43 | 6f 6e 74 72 6f 6c 20 28 |...MoveC|ontrol (|
|000037d0| 73 63 72 6f 6c 6c 2c 20 | 72 2e 6c 65 66 74 2c 20 |scroll, |r.left, |
|000037e0| 72 2e 74 6f 70 29 3b 0d | 09 09 4f 76 65 72 68 61 |r.top);.|..Overha|
|000037f0| 75 6c 44 69 73 70 6c 61 | 79 20 28 64 6f 63 29 3b |ulDispla|y (doc);|
|00003800| 0d 09 09 53 68 6f 77 43 | 6f 6e 74 72 6f 6c 20 28 |...ShowC|ontrol (|
|00003810| 73 63 72 6f 6c 6c 29 3b | 0d 09 7d 0d 09 65 6c 73 |scroll);|..}..els|
|00003820| 65 0d 09 7b 0d 09 09 72 | 20 3d 20 28 2a 2a 68 54 |e..{...r| = (**hT|
|00003830| 45 29 2e 76 69 65 77 52 | 65 63 74 3b 0d 09 09 54 |E).viewR|ect;...T|
|00003840| 45 55 70 64 61 74 65 20 | 28 26 72 2c 20 68 54 45 |EUpdate |(&r, hTE|
|00003850| 29 3b 09 09 2f 2a 20 72 | 65 64 72 61 77 20 74 65 |);../* r|edraw te|
|00003860| 78 74 20 64 69 73 70 6c | 61 79 20 2a 2f 0d 09 09 |xt displ|ay */...|
|00003870| 69 66 20 28 57 69 6e 64 | 6f 77 49 73 41 63 74 69 |if (Wind|owIsActi|
|00003880| 76 65 20 28 77 29 29 0d | 09 09 09 44 72 61 77 43 |ve (w)).|...DrawC|
|00003890| 6f 6e 74 72 6f 6c 73 20 | 28 77 29 3b 09 2f 2a 20 |ontrols |(w);./* |
|000038a0| 72 65 64 72 61 77 20 73 | 63 72 6f 6c 6c 20 62 61 |redraw s|croll ba|
|000038b0| 72 20 2a 2f 0d 09 09 65 | 6c 73 65 0d 09 09 7b 0d |r */...e|lse...{.|
|000038c0| 09 09 09 2f 2a 20 64 72 | 61 77 20 6f 75 74 6c 69 |.../* dr|aw outli|
|000038d0| 6e 65 20 6f 66 20 73 63 | 72 6f 6c 6c 2c 20 65 72 |ne of sc|roll, er|
|000038e0| 61 73 65 20 69 6e 74 65 | 72 69 6f 72 20 2a 2f 0d |ase inte|rior */.|
|000038f0| 09 09 09 72 20 3d 20 28 | 2a 2a 73 63 72 6f 6c 6c |...r = (|**scroll|
|00003900| 29 2e 63 6f 6e 74 72 6c | 52 65 63 74 3b 0d 09 09 |).contrl|Rect;...|
|00003910| 09 46 72 61 6d 65 52 65 | 63 74 20 28 26 72 29 3b |.FrameRe|ct (&r);|
|00003920| 0d 09 09 09 49 6e 73 65 | 74 52 65 63 74 20 28 26 |....Inse|tRect (&|
|00003930| 72 2c 20 31 2c 20 31 29 | 3b 0d 09 09 09 45 72 61 |r, 1, 1)|;....Era|
|00003940| 73 65 52 65 63 74 20 28 | 26 72 29 3b 0d 09 09 7d |seRect (|&r);...}|
|00003950| 0d 09 7d 0d 0d 09 44 72 | 61 77 47 72 6f 77 42 6f |..}...Dr|awGrowBo|
|00003960| 78 20 28 77 29 3b 0d 7d | 0d 0d 0d 2f 2a 0d 20 2a |x (w);.}|.../*. *|
|00003970| 20 57 68 65 6e 20 74 68 | 65 20 77 69 6e 64 6f 77 | When th|e window|
|00003980| 20 63 6f 6d 65 73 20 61 | 63 74 69 76 65 2c 20 68 | comes a|ctive, h|
|00003990| 69 67 68 6c 69 67 68 74 | 20 74 68 65 20 73 63 72 |ighlight| the scr|
|000039a0| 6f 6c 6c 20 62 61 72 20 | 61 70 70 72 6f 70 72 69 |oll bar |appropri|
|000039b0| 61 74 65 6c 79 2e 0d 20 | 2a 20 57 68 65 6e 20 74 |ately.. |* When t|
|000039c0| 68 65 20 77 69 6e 64 6f | 77 20 69 73 20 64 65 61 |he windo|w is dea|
|000039d0| 63 74 69 76 61 74 65 64 | 2c 20 68 69 64 65 20 74 |ctivated|, hide t|
|000039e0| 68 65 20 73 63 72 6f 6c | 6c 20 62 61 72 20 28 74 |he scrol|l bar (t|
|000039f0| 68 69 73 20 69 73 20 64 | 72 61 77 6e 0d 20 2a 20 |his is d|rawn. * |
|00003a00| 69 6d 6d 65 64 69 61 74 | 65 6c 79 20 72 61 74 68 |immediat|ely rath|
|00003a10| 65 72 20 74 68 61 6e 20 | 69 6e 76 61 6c 69 64 61 |er than |invalida|
|00003a20| 74 69 6e 67 20 74 68 65 | 20 72 65 63 74 61 6e 67 |ting the| rectang|
|00003a30| 6c 65 20 61 6e 64 20 77 | 61 69 74 69 6e 67 20 66 |le and w|aiting f|
|00003a40| 6f 72 0d 20 2a 20 55 70 | 64 61 74 65 28 29 2c 20 |or. * Up|date(), |
|00003a50| 62 65 63 61 75 73 65 20 | 74 68 61 74 20 6a 75 73 |because |that jus|
|00003a60| 74 20 73 65 65 6d 73 20 | 74 6f 6f 20 73 6c 6f 77 |t seems |too slow|
|00003a70| 29 2e 0d 20 2a 0d 20 2a | 20 52 65 64 72 61 77 20 |).. *. *| Redraw |
|00003a80| 74 68 65 20 67 72 6f 77 | 20 62 6f 78 2e 0d 20 2a |the grow| box.. *|
|00003a90| 0d 20 2a 20 4e 6f 74 69 | 66 79 20 74 68 65 20 68 |. * Noti|fy the h|
|00003aa0| 6f 73 74 20 61 73 20 61 | 70 70 72 6f 70 72 69 61 |ost as a|ppropria|
|00003ab0| 74 65 2e 0d 20 2a 0d 20 | 2a 20 4e 6f 74 65 20 74 |te.. *. |* Note t|
|00003ac0| 68 61 74 20 63 6c 69 63 | 6b 69 6e 67 20 63 6c 6f |hat clic|king clo|
|00003ad0| 73 65 20 62 6f 78 20 68 | 69 64 65 73 20 74 68 65 |se box h|ides the|
|00003ae0| 20 77 69 6e 64 6f 77 2c | 20 77 68 69 63 68 20 67 | window,| which g|
|00003af0| 65 6e 65 72 61 74 65 73 | 20 61 0d 20 2a 20 64 65 |enerates| a. * de|
|00003b00| 61 63 74 69 76 61 74 65 | 20 65 76 65 6e 74 2c 20 |activate| event, |
|00003b10| 73 6f 20 74 68 65 72 65 | 20 69 73 20 6e 6f 20 6e |so there| is no n|
|00003b20| 65 65 64 20 66 6f 72 20 | 61 20 63 6c 6f 73 65 20 |eed for |a close |
|00003b30| 6e 6f 74 69 66 69 65 72 | 2e 0d 20 2a 2f 0d 0d 73 |notifier|.. */..s|
|00003b40| 74 61 74 69 63 20 70 61 | 73 63 61 6c 20 76 6f 69 |tatic pa|scal voi|
|00003b50| 64 0d 41 63 74 69 76 61 | 74 65 20 28 42 6f 6f 6c |d.Activa|te (Bool|
|00003b60| 65 61 6e 20 61 63 74 69 | 76 65 29 0d 7b 0d 57 69 |ean acti|ve).{.Wi|
|00003b70| 6e 64 6f 77 50 74 72 09 | 77 3b 0d 44 6f 63 48 61 |ndowPtr.|w;.DocHa|
|00003b80| 6e 64 6c 65 09 64 6f 63 | 3b 0d 43 6f 6e 74 72 6f |ndle.doc|;.Contro|
|00003b90| 6c 48 61 6e 64 6c 65 09 | 73 63 72 6f 6c 6c 3b 0d |lHandle.|scroll;.|
|00003ba0| 52 67 6e 48 61 6e 64 6c | 65 09 6f 6c 64 43 6c 69 |RgnHandl|e.oldCli|
|00003bb0| 70 3b 0d 52 65 63 74 09 | 09 72 3b 0d 0d 09 47 65 |p;.Rect.|.r;...Ge|
|00003bc0| 74 50 6f 72 74 20 28 26 | 77 29 3b 0d 09 64 6f 63 |tPort (&|w);..doc|
|00003bd0| 20 3d 20 57 69 6e 64 44 | 6f 63 48 61 6e 64 6c 65 | = WindD|ocHandle|
|00003be0| 20 28 77 29 3b 0d 09 73 | 63 72 6f 6c 6c 20 3d 20 | (w);..s|croll = |
|00003bf0| 44 6f 63 53 63 72 6f 6c | 6c 20 28 64 6f 63 29 3b |DocScrol|l (doc);|
|00003c00| 0d 0d 09 44 72 61 77 47 | 72 6f 77 42 6f 78 20 28 |...DrawG|rowBox (|
|00003c10| 77 29 3b 0d 09 69 66 20 | 28 61 63 74 69 76 65 29 |w);..if |(active)|
|00003c20| 0d 09 7b 0d 09 09 48 69 | 6c 69 74 65 53 63 72 6f |..{...Hi|liteScro|
|00003c30| 6c 6c 20 28 64 6f 63 29 | 3b 0d 09 09 53 68 6f 77 |ll (doc)|;...Show|
|00003c40| 43 6f 6e 74 72 6f 6c 20 | 28 73 63 72 6f 6c 6c 29 |Control |(scroll)|
|00003c50| 3b 0d 09 7d 0d 09 65 6c | 73 65 0d 09 7b 0d 09 09 |;..}..el|se..{...|
|00003c60| 2f 2a 20 68 69 64 65 20 | 73 63 72 6f 6c 6c 20 62 |/* hide |scroll b|
|00003c70| 75 74 20 64 6f 6e 27 74 | 20 73 68 6f 77 20 69 74 |ut don't| show it|
|00003c80| 20 62 65 69 6e 67 20 68 | 69 64 64 65 6e 20 2a 2f | being h|idden */|
|00003c90| 0d 09 09 6f 6c 64 43 6c | 69 70 20 3d 20 4e 65 77 |...oldCl|ip = New|
|00003ca0| 52 67 6e 20 28 29 3b 0d | 09 09 47 65 74 43 6c 69 |Rgn ();.|..GetCli|
|00003cb0| 70 20 28 6f 6c 64 43 6c | 69 70 29 3b 0d 09 09 53 |p (oldCl|ip);...S|
|00003cc0| 65 74 52 65 63 74 20 28 | 26 72 2c 20 30 2c 20 30 |etRect (|&r, 0, 0|
|00003cd0| 2c 20 30 2c 20 30 29 3b | 0d 09 09 43 6c 69 70 52 |, 0, 0);|...ClipR|
|00003ce0| 65 63 74 20 28 26 72 29 | 3b 0d 09 09 48 69 64 65 |ect (&r)|;...Hide|
|00003cf0| 43 6f 6e 74 72 6f 6c 20 | 28 73 63 72 6f 6c 6c 29 |Control |(scroll)|
|00003d00| 3b 0d 09 09 53 65 74 43 | 6c 69 70 20 28 6f 6c 64 |;...SetC|lip (old|
|00003d10| 43 6c 69 70 29 3b 0d 09 | 09 44 69 73 70 6f 73 65 |Clip);..|.Dispose|
|00003d20| 52 67 6e 20 28 6f 6c 64 | 43 6c 69 70 29 3b 0d 09 |Rgn (old|Clip);..|
|00003d30| 09 2f 2a 20 6e 6f 77 20 | 65 72 61 73 65 20 69 6e |./* now |erase in|
|00003d40| 73 69 64 65 20 6f 66 20 | 73 63 72 6f 6c 6c 20 28 |side of |scroll (|
|00003d50| 62 75 74 20 6e 6f 74 20 | 6f 75 74 6c 69 6e 65 2c |but not |outline,|
|00003d60| 20 74 6f 20 61 76 6f 69 | 64 20 66 6c 69 63 6b 65 | to avoi|d flicke|
|00003d70| 72 29 20 2a 2f 0d 09 09 | 72 20 3d 20 28 2a 2a 73 |r) */...|r = (**s|
|00003d80| 63 72 6f 6c 6c 29 2e 63 | 6f 6e 74 72 6c 52 65 63 |croll).c|ontrlRec|
|00003d90| 74 3b 09 09 2f 2a 20 65 | 72 61 73 65 20 73 63 72 |t;../* e|rase scr|
|00003da0| 6f 6c 6c 20 2a 2f 0d 09 | 09 49 6e 73 65 74 52 65 |oll */..|.InsetRe|
|00003db0| 63 74 20 28 26 72 2c 20 | 31 2c 20 31 29 3b 09 09 |ct (&r, |1, 1);..|
|00003dc0| 09 09 2f 2a 20 62 75 74 | 20 6e 6f 74 20 6f 75 74 |../* but| not out|
|00003dd0| 6c 69 6e 65 20 2a 2f 0d | 09 09 45 72 61 73 65 52 |line */.|..EraseR|
|00003de0| 65 63 74 20 28 26 72 29 | 3b 0d 09 7d 0d 0d 09 69 |ect (&r)|;..}...i|
|00003df0| 66 20 28 44 6f 63 41 63 | 74 69 76 61 74 65 50 72 |f (DocAc|tivatePr|
|00003e00| 6f 63 20 28 64 6f 63 29 | 20 21 3d 20 6e 69 6c 29 |oc (doc)| != nil)|
|00003e10| 0d 09 09 28 2a 44 6f 63 | 41 63 74 69 76 61 74 65 |...(*Doc|Activate|
|00003e20| 50 72 6f 63 20 28 64 6f | 63 29 29 20 28 61 63 74 |Proc (do|c)) (act|
|00003e30| 69 76 65 29 3b 0d 7d 0d | 0d 0d 2f 2a 0d 20 2a 20 |ive);.}.|../*. * |
|00003e40| 43 6c 6f 62 62 65 72 20 | 61 20 64 69 73 70 6c 61 |Clobber |a displa|
|00003e50| 79 20 77 69 6e 64 6f 77 | 2e 20 20 54 68 69 73 20 |y window|. This |
|00003e60| 72 6f 75 74 69 6e 65 20 | 69 73 20 77 72 69 74 74 |routine |is writt|
|00003e70| 65 6e 20 64 65 66 65 6e | 73 69 76 65 6c 79 20 6f |en defen|sively o|
|00003e80| 6e 20 74 68 65 0d 20 2a | 20 61 73 73 75 6d 70 74 |n the. *| assumpt|
|00003e90| 69 6f 6e 20 74 68 61 74 | 20 6e 6f 74 20 61 6c 6c |ion that| not all|
|00003ea0| 20 70 69 65 63 65 73 20 | 6f 66 20 61 20 63 6f 6d | pieces |of a com|
|00003eb0| 70 6c 65 74 65 20 64 69 | 73 70 6c 61 79 20 77 69 |plete di|splay wi|
|00003ec0| 6e 64 6f 77 20 61 72 65 | 20 70 72 65 73 65 6e 74 |ndow are| present|
|00003ed0| 2e 0d 20 2a 20 54 68 69 | 73 20 61 6c 6c 6f 77 73 |.. * Thi|s allows|
|00003ee0| 20 69 74 20 74 6f 20 62 | 65 20 63 61 6c 6c 65 64 | it to b|e called|
|00003ef0| 20 62 79 20 53 6b 65 6c | 52 6d 76 65 57 69 6e 64 | by Skel|RmveWind|
|00003f00| 28 29 20 64 75 72 69 6e | 67 20 77 69 6e 64 6f 77 |() durin|g window|
|00003f10| 20 63 72 65 61 74 69 6f | 6e 0d 20 2a 20 61 74 74 | creatio|n. * att|
|00003f20| 65 6d 70 74 73 20 69 66 | 20 61 6c 6c 6f 63 61 74 |empts if| allocat|
|00003f30| 69 6f 6e 73 20 66 61 69 | 6c 2e 0d 20 2a 0d 20 2a |ions fai|l.. *. *|
|00003f40| 20 54 68 65 20 77 69 6e | 64 6f 77 27 73 20 73 6b | The win|dow's sk|
|00003f50| 65 6c 57 50 72 6f 70 44 | 69 73 70 6c 61 79 57 69 |elWPropD|isplayWi|
|00003f60| 6e 64 20 70 72 6f 70 65 | 72 74 79 20 73 74 72 75 |nd prope|rty stru|
|00003f70| 63 74 75 72 65 20 77 69 | 6c 6c 20 62 65 20 64 69 |cture wi|ll be di|
|00003f80| 73 70 6f 73 65 64 0d 20 | 2a 20 6f 66 20 62 79 20 |sposed. |* of by |
|00003f90| 54 72 61 6e 73 53 6b 65 | 6c 2c 20 62 75 74 20 74 |TransSke|l, but t|
|00003fa0| 68 65 20 64 61 74 61 20 | 61 73 73 6f 63 69 61 74 |he data |associat|
|00003fb0| 65 64 20 77 69 74 68 20 | 69 74 20 28 72 65 74 75 |ed with |it (retu|
|00003fc0| 72 6e 65 64 20 62 79 20 | 57 69 6e 64 44 6f 63 48 |rned by |WindDocH|
|00003fd0| 61 6e 64 6c 65 28 29 29 | 0d 20 2a 20 6d 75 73 74 |andle())|. * must|
|00003fe0| 20 62 65 20 64 69 73 70 | 6f 73 65 64 20 6f 66 20 | be disp|osed of |
|00003ff0| 68 65 72 65 2e 0d 20 2a | 0d 20 2a 20 49 66 20 74 |here.. *|. * If t|
|00004000| 68 65 20 77 69 6e 64 6f | 77 20 62 65 69 6e 67 20 |he windo|w being |
|00004010| 63 6c 6f 62 62 65 72 65 | 64 20 69 73 20 74 68 65 |clobbere|d is the|
|00004020| 20 63 75 72 72 65 6e 74 | 20 6f 75 74 70 75 74 20 | current| output |
|00004030| 77 69 6e 64 6f 77 2c 20 | 64 6f 0d 20 2a 20 53 65 |window, |do. * Se|
|00004040| 74 44 57 69 6e 64 6f 77 | 20 28 6e 69 6c 29 20 74 |tDWindow| (nil) t|
|00004050| 6f 20 74 75 72 6e 20 6f | 75 74 70 75 74 20 6f 66 |o turn o|utput of|
|00004060| 66 2e 20 20 41 6c 73 6f | 20 73 65 74 20 64 69 73 |f. Also| set dis|
|00004070| 70 57 69 6e 64 20 74 6f | 20 6e 69 6c 20 69 6e 0d |pWind to| nil in.|
|00004080| 20 2a 20 63 61 73 65 20 | 74 68 65 20 77 69 6e 64 | * case |the wind|
|00004090| 6f 77 20 69 73 20 74 68 | 65 20 63 75 72 72 65 6e |ow is th|e curren|
|000040a0| 74 20 64 69 73 70 6c 61 | 79 20 77 69 6e 64 6f 77 |t displa|y window|
|000040b0| 2e 0d 20 2a 2f 0d 0d 73 | 74 61 74 69 63 20 70 61 |.. */..s|tatic pa|
|000040c0| 73 63 61 6c 20 76 6f 69 | 64 0d 43 6c 6f 62 62 65 |scal voi|d.Clobbe|
|000040d0| 72 20 28 76 6f 69 64 29 | 0d 7b 0d 57 69 6e 64 6f |r (void)|.{.Windo|
|000040e0| 77 50 74 72 09 77 3b 0d | 44 6f 63 48 61 6e 64 6c |wPtr.w;.|DocHandl|
|000040f0| 65 09 64 6f 63 3b 0d 54 | 45 48 61 6e 64 6c 65 09 |e.doc;.T|EHandle.|
|00004100| 68 54 45 3b 0d 0d 09 47 | 65 74 50 6f 72 74 20 28 |hTE;...G|etPort (|
|00004110| 26 77 29 3b 0d 09 64 6f | 63 20 3d 20 57 69 6e 64 |&w);..do|c = Wind|
|00004120| 44 6f 63 48 61 6e 64 6c | 65 20 28 77 29 3b 0d 0d |DocHandl|e (w);..|
|00004130| 09 69 66 20 28 77 20 3d | 3d 20 63 75 72 44 69 73 |.if (w =|= curDis|
|00004140| 70 57 69 6e 64 29 0d 09 | 09 53 65 74 44 57 69 6e |pWind)..|.SetDWin|
|00004150| 64 6f 77 20 28 6e 69 6c | 29 3b 0d 0d 09 2f 2a 0d |dow (nil|);.../*.|
|00004160| 09 20 2a 20 54 6f 73 73 | 20 64 6f 63 75 6d 65 6e |. * Toss| documen|
|00004170| 74 20 72 65 63 6f 72 64 | 20 61 6e 64 20 61 6e 79 |t record| and any|
|00004180| 20 70 69 65 63 65 73 20 | 74 68 61 74 20 65 78 69 | pieces |that exi|
|00004190| 73 74 0d 09 20 2a 2f 0d | 09 69 66 20 28 64 6f 63 |st.. */.|.if (doc|
|000041a0| 20 21 3d 20 28 44 6f 63 | 48 61 6e 64 6c 65 29 20 | != (Doc|Handle) |
|000041b0| 6e 69 6c 29 0d 09 7b 0d | 09 09 69 66 20 28 28 68 |nil)..{.|..if ((h|
|000041c0| 54 45 20 3d 20 44 6f 63 | 54 45 20 28 64 6f 63 29 |TE = Doc|TE (doc)|
|000041d0| 29 20 21 3d 20 28 54 45 | 48 61 6e 64 6c 65 29 20 |) != (TE|Handle) |
|000041e0| 6e 69 6c 29 0d 09 09 09 | 54 45 44 69 73 70 6f 73 |nil)....|TEDispos|
|000041f0| 65 20 28 68 54 45 29 3b | 09 09 09 09 09 09 2f 2a |e (hTE);|....../*|
|00004200| 20 74 6f 73 73 20 74 65 | 78 74 20 72 65 63 6f 72 | toss te|xt recor|
|00004210| 64 20 2a 2f 0d 09 09 44 | 69 73 70 6f 73 65 48 61 |d */...D|isposeHa|
|00004220| 6e 64 6c 65 20 28 28 48 | 61 6e 64 6c 65 29 20 64 |ndle ((H|andle) d|
|00004230| 6f 63 29 3b 0d 09 7d 0d | 09 44 69 73 70 6f 73 65 |oc);..}.|.Dispose|
|00004240| 57 69 6e 64 6f 77 20 28 | 77 29 3b 09 09 09 2f 2a |Window (|w);.../*|
|00004250| 20 74 6f 73 73 20 77 69 | 6e 64 6f 77 20 28 73 63 | toss wi|ndow (sc|
|00004260| 72 6f 6c 6c 20 62 61 72 | 2c 20 74 6f 6f 29 20 2a |roll bar|, too) *|
|00004270| 2f 0d 7d 0d 0d 0d 2f 2a | 20 2d 2d 2d 2d 2d 2d 2d |/.}.../*| -------|
|00004280| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00004290| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000042a0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000042b0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 20 2a 2f 0d 2f 2a 09 |--------|- */./*.|
|000042c0| 09 09 09 09 09 09 43 6f | 6e 74 72 6f 6c 20 52 6f |......Co|ntrol Ro|
|000042d0| 75 74 69 6e 65 73 09 09 | 09 09 09 09 2a 2f 0d 2f |utines..|....*/./|
|000042e0| 2a 20 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |* ------|--------|
|000042f0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00004300| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00004310| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00004320| 2d 2d 20 2a 2f 0d 0d 0d | 2f 2a 0d 20 2a 20 54 65 |-- */...|/*. * Te|
|00004330| 73 74 20 77 68 65 74 68 | 65 72 20 61 20 77 69 6e |st wheth|er a win|
|00004340| 64 6f 77 20 69 73 20 61 | 20 6c 65 67 61 6c 20 64 |dow is a| legal d|
|00004350| 69 73 70 6c 61 79 20 77 | 69 6e 64 6f 77 20 6f 72 |isplay w|indow or|
|00004360| 20 6e 6f 74 0d 20 2a 2f | 0d 0d 70 61 73 63 61 6c | not. */|..pascal|
|00004370| 20 42 6f 6f 6c 65 61 6e | 0d 49 73 44 57 69 6e 64 | Boolean|.IsDWind|
|00004380| 6f 77 20 28 57 69 6e 64 | 6f 77 50 74 72 20 77 29 |ow (Wind|owPtr w)|
|00004390| 0d 7b 0d 09 72 65 74 75 | 72 6e 20 28 57 69 6e 64 |.{..retu|rn (Wind|
|000043a0| 44 6f 63 48 61 6e 64 6c | 65 20 28 77 29 20 21 3d |DocHandl|e (w) !=|
|000043b0| 20 6e 69 6c 29 3b 0d 7d | 0d 0d 0d 2f 2a 0d 20 2a | nil);.}|.../*. *|
|000043c0| 20 52 65 74 75 72 6e 20 | 68 61 6e 64 6c 65 20 74 | Return |handle t|
|000043d0| 6f 20 64 69 73 70 6c 61 | 79 20 77 69 6e 64 6f 77 |o displa|y window|
|000043e0| 27 73 20 74 65 78 74 20 | 72 65 63 6f 72 64 0d 20 |'s text |record. |
|000043f0| 2a 2f 0d 0d 70 61 73 63 | 61 6c 20 54 45 48 61 6e |*/..pasc|al TEHan|
|00004400| 64 6c 65 0d 47 65 74 44 | 57 69 6e 64 6f 77 54 45 |dle.GetD|WindowTE|
|00004410| 20 28 57 69 6e 64 6f 77 | 50 74 72 20 77 29 0d 7b | (Window|Ptr w).{|
|00004420| 0d 44 6f 63 48 61 6e 64 | 6c 65 09 64 6f 63 3b 0d |.DocHand|le.doc;.|
|00004430| 0d 09 72 65 74 75 72 6e | 20 28 28 64 6f 63 20 3d |..return| ((doc =|
|00004440| 20 57 69 6e 64 44 6f 63 | 48 61 6e 64 6c 65 20 28 | WindDoc|Handle (|
|00004450| 77 29 29 20 3d 3d 20 6e | 69 6c 20 3f 20 6e 69 6c |w)) == n|il ? nil|
|00004460| 20 3a 20 44 6f 63 54 45 | 20 28 64 6f 63 29 29 3b | : DocTE| (doc));|
|00004470| 0d 7d 0d 0d 0d 2f 2a 0d | 20 2a 20 43 68 61 6e 67 |.}.../*.| * Chang|
|00004480| 65 20 74 68 65 20 74 65 | 78 74 20 64 69 73 70 6c |e the te|xt displ|
|00004490| 61 79 20 63 68 61 72 61 | 63 74 65 72 69 73 74 69 |ay chara|cteristi|
|000044a0| 63 73 20 6f 66 20 61 20 | 64 69 73 70 6c 61 79 20 |cs of a |display |
|000044b0| 77 69 6e 64 6f 77 0d 20 | 2a 20 61 6e 64 20 72 65 |window. |* and re|
|000044c0| 64 69 73 70 6c 61 79 20 | 69 74 2e 20 20 41 73 20 |display |it. As |
|000044d0| 61 20 73 69 64 65 20 65 | 66 66 65 63 74 2c 20 74 |a side e|ffect, t|
|000044e0| 68 69 73 20 61 6c 77 61 | 79 73 20 73 63 72 6f 6c |his alwa|ys scrol|
|000044f0| 6c 73 20 74 6f 20 74 68 | 65 0d 20 2a 20 68 6f 6d |ls to th|e. * hom|
|00004500| 65 20 70 6f 73 69 74 69 | 6f 6e 2e 0d 20 2a 2f 0d |e positi|on.. */.|
|00004510| 0d 70 61 73 63 61 6c 20 | 76 6f 69 64 0d 53 65 74 |.pascal |void.Set|
|00004520| 44 57 69 6e 64 6f 77 53 | 74 79 6c 65 20 28 57 69 |DWindowS|tyle (Wi|
|00004530| 6e 64 6f 77 50 74 72 20 | 77 2c 20 73 68 6f 72 74 |ndowPtr |w, short|
|00004540| 20 66 6f 6e 74 2c 20 73 | 68 6f 72 74 20 73 69 7a | font, s|hort siz|
|00004550| 65 2c 20 73 68 6f 72 74 | 20 77 72 61 70 2c 20 73 |e, short| wrap, s|
|00004560| 68 6f 72 74 20 6a 75 73 | 74 29 0d 7b 0d 44 6f 63 |hort jus|t).{.Doc|
|00004570| 48 61 6e 64 6c 65 09 64 | 6f 63 3b 0d 47 72 61 66 |Handle.d|oc;.Graf|
|00004580| 50 74 72 09 09 73 61 76 | 65 50 6f 72 74 3b 0d 46 |Ptr..sav|ePort;.F|
|00004590| 6f 6e 74 49 6e 66 6f 09 | 66 3b 0d 54 45 48 61 6e |ontInfo.|f;.TEHan|
|000045a0| 64 6c 65 09 68 54 45 3b | 0d 52 65 63 74 09 09 72 |dle.hTE;|.Rect..r|
|000045b0| 3b 0d 0d 09 69 66 20 28 | 77 20 3d 3d 20 6e 69 6c |;...if (|w == nil|
|000045c0| 29 09 09 09 2f 2a 20 72 | 65 73 65 74 20 77 69 6e |).../* r|eset win|
|000045d0| 64 6f 77 20 63 72 65 61 | 74 69 6f 6e 20 64 65 66 |dow crea|tion def|
|000045e0| 61 75 6c 74 73 20 2a 2f | 0d 09 7b 0d 09 09 64 5f |aults */|..{...d_|
|000045f0| 66 6f 6e 74 20 3d 20 66 | 6f 6e 74 3b 0d 09 09 64 |font = f|ont;...d|
|00004600| 5f 73 69 7a 65 20 3d 20 | 73 69 7a 65 3b 0d 09 09 |_size = |size;...|
|00004610| 64 5f 77 72 61 70 20 3d | 20 77 72 61 70 3b 0d 09 |d_wrap =| wrap;..|
|00004620| 09 64 5f 6a 75 73 74 20 | 3d 20 6a 75 73 74 3b 0d |.d_just |= just;.|
|00004630| 09 09 72 65 74 75 72 6e | 3b 0d 09 7d 0d 0d 09 69 |..return|;..}...i|
|00004640| 66 20 28 28 64 6f 63 20 | 3d 20 57 69 6e 64 44 6f |f ((doc |= WindDo|
|00004650| 63 48 61 6e 64 6c 65 20 | 28 77 29 29 20 21 3d 20 |cHandle |(w)) != |
|00004660| 28 44 6f 63 48 61 6e 64 | 6c 65 29 20 6e 69 6c 29 |(DocHand|le) nil)|
|00004670| 0d 09 7b 0d 09 09 47 65 | 74 50 6f 72 74 20 28 26 |..{...Ge|tPort (&|
|00004680| 73 61 76 65 50 6f 72 74 | 29 3b 0d 09 09 53 65 74 |savePort|);...Set|
|00004690| 50 6f 72 74 20 28 77 29 | 3b 0d 09 09 68 54 45 20 |Port (w)|;...hTE |
|000046a0| 3d 20 44 6f 63 54 45 20 | 28 64 6f 63 29 3b 0d 09 |= DocTE |(doc);..|
|000046b0| 09 72 20 3d 20 28 2a 2a | 68 54 45 29 2e 76 69 65 |.r = (**|hTE).vie|
|000046c0| 77 52 65 63 74 3b 0d 09 | 09 45 72 61 73 65 52 65 |wRect;..|.EraseRe|
|000046d0| 63 74 20 28 26 72 29 3b | 0d 09 09 72 20 3d 20 28 |ct (&r);|...r = (|
|000046e0| 2a 2a 68 54 45 29 2e 64 | 65 73 74 52 65 63 74 3b |**hTE).d|estRect;|
|000046f0| 09 2f 2a 20 73 63 72 6f | 6c 6c 20 68 6f 6d 65 20 |./* scro|ll home |
|00004700| 77 69 74 68 6f 75 74 20 | 72 65 64 72 61 77 69 6e |without |redrawin|
|00004710| 67 20 2a 2f 0d 09 09 4f | 66 66 73 65 74 52 65 63 |g */...O|ffsetRec|
|00004720| 74 20 28 26 72 2c 20 30 | 2c 20 32 20 2d 20 72 2e |t (&r, 0|, 2 - r.|
|00004730| 74 6f 70 29 3b 0d 09 09 | 28 2a 2a 68 54 45 29 2e |top);...|(**hTE).|
|00004740| 64 65 73 74 52 65 63 74 | 20 3d 20 72 3b 0d 0d 09 |destRect| = r;...|
|00004750| 09 28 2a 2a 68 54 45 29 | 2e 63 72 4f 6e 6c 79 20 |.(**hTE)|.crOnly |
|00004760| 3d 20 77 72 61 70 3b 09 | 2f 2a 20 73 65 74 20 77 |= wrap;.|/* set w|
|00004770| 6f 72 64 20 77 72 61 70 | 20 2a 2f 0d 09 09 54 45 |ord wrap| */...TE|
|00004780| 53 65 74 4a 75 73 74 20 | 28 6a 75 73 74 2c 20 68 |SetJust |(just, h|
|00004790| 54 45 29 3b 09 2f 2a 20 | 73 65 74 20 6a 75 73 74 |TE);./* |set just|
|000047a0| 69 66 69 63 61 74 69 6f | 6e 20 2a 2f 0d 0d 09 09 |ificatio|n */....|
|000047b0| 54 65 78 74 46 6f 6e 74 | 20 28 66 6f 6e 74 29 3b |TextFont| (font);|
|000047c0| 09 20 09 2f 2a 20 73 65 | 74 20 74 68 65 20 66 6f |. ./* se|t the fo|
|000047d0| 6e 74 20 61 6e 64 20 70 | 6f 69 6e 74 20 73 69 7a |nt and p|oint siz|
|000047e0| 65 20 2a 2f 0d 09 09 54 | 65 78 74 53 69 7a 65 20 |e */...T|extSize |
|000047f0| 28 73 69 7a 65 29 3b 09 | 09 2f 2a 20 6f 66 20 74 |(size);.|./* of t|
|00004800| 65 78 74 20 72 65 63 6f | 72 64 20 28 74 68 69 73 |ext reco|rd (this|
|00004810| 20 69 73 20 74 68 65 20 | 2a 2f 0d 09 09 47 65 74 | is the |*/...Get|
|00004820| 46 6f 6e 74 49 6e 66 6f | 20 28 26 66 29 3b 09 09 |FontInfo| (&f);..|
|00004830| 2f 2a 20 68 61 72 64 20 | 70 61 72 74 29 20 2a 2f |/* hard |part) */|
|00004840| 0d 09 09 28 2a 2a 68 54 | 45 29 2e 6c 69 6e 65 48 |...(**hT|E).lineH|
|00004850| 65 69 67 68 74 20 3d 20 | 66 2e 61 73 63 65 6e 74 |eight = |f.ascent|
|00004860| 20 2b 20 66 2e 64 65 73 | 63 65 6e 74 20 2b 20 66 | + f.des|cent + f|
|00004870| 2e 6c 65 61 64 69 6e 67 | 3b 0d 09 09 28 2a 2a 68 |.leading|;...(**h|
|00004880| 54 45 29 2e 66 6f 6e 74 | 41 73 63 65 6e 74 20 3d |TE).font|Ascent =|
|00004890| 20 66 2e 61 73 63 65 6e | 74 3b 0d 09 09 28 2a 2a | f.ascen|t;...(**|
|000048a0| 68 54 45 29 2e 74 78 46 | 6f 6e 74 20 3d 20 66 6f |hTE).txF|ont = fo|
|000048b0| 6e 74 3b 0d 09 09 28 2a | 2a 68 54 45 29 2e 74 78 |nt;...(*|*hTE).tx|
|000048c0| 53 69 7a 65 20 3d 20 73 | 69 7a 65 3b 0d 0d 09 09 |Size = s|ize;....|
|000048d0| 4f 76 65 72 68 61 75 6c | 44 69 73 70 6c 61 79 20 |Overhaul|Display |
|000048e0| 28 64 6f 63 29 3b 0d 09 | 09 53 65 74 50 6f 72 74 |(doc);..|.SetPort|
|000048f0| 20 28 73 61 76 65 50 6f | 72 74 29 3b 0d 09 7d 0d | (savePo|rt);..}.|
|00004900| 7d 0d 0d 0d 2f 2a 0d 20 | 2a 20 53 63 72 6f 6c 6c |}.../*. |* Scroll|
|00004910| 20 74 68 65 20 74 65 78 | 74 20 69 6e 20 74 68 65 | the tex|t in the|
|00004920| 20 77 69 6e 64 6f 77 20 | 73 6f 20 74 68 61 74 20 | window |so that |
|00004930| 6c 69 6e 65 20 6c 69 6e | 65 4e 75 6d 20 69 73 20 |line lin|eNum is |
|00004940| 61 74 20 74 68 65 20 74 | 6f 70 2e 0d 20 2a 20 46 |at the t|op.. * F|
|00004950| 69 72 73 74 20 6c 69 6e | 65 20 69 73 20 6c 69 6e |irst lin|e is lin|
|00004960| 65 20 7a 65 72 6f 2e 0d | 20 2a 2f 0d 0d 70 61 73 |e zero..| */..pas|
|00004970| 63 61 6c 20 76 6f 69 64 | 0d 53 65 74 44 57 69 6e |cal void|.SetDWin|
|00004980| 64 6f 77 50 6f 73 20 28 | 57 69 6e 64 6f 77 50 74 |dowPos (|WindowPt|
|00004990| 72 20 77 2c 20 73 68 6f | 72 74 20 6c 69 6e 65 4e |r w, sho|rt lineN|
|000049a0| 75 6d 29 0d 7b 0d 47 72 | 61 66 50 74 72 09 09 73 |um).{.Gr|afPtr..s|
|000049b0| 61 76 65 50 6f 72 74 3b | 0d 44 6f 63 48 61 6e 64 |avePort;|.DocHand|
|000049c0| 6c 65 09 64 6f 63 3b 0d | 0d 09 69 66 20 28 28 64 |le.doc;.|..if ((d|
|000049d0| 6f 63 20 3d 20 57 69 6e | 64 44 6f 63 48 61 6e 64 |oc = Win|dDocHand|
|000049e0| 6c 65 20 28 77 29 29 20 | 21 3d 20 28 44 6f 63 48 |le (w)) |!= (DocH|
|000049f0| 61 6e 64 6c 65 29 20 6e | 69 6c 29 0d 09 7b 0d 09 |andle) n|il)..{..|
|00004a00| 09 47 65 74 50 6f 72 74 | 20 28 26 73 61 76 65 50 |.GetPort| (&saveP|
|00004a10| 6f 72 74 29 3b 0d 09 09 | 53 65 74 50 6f 72 74 20 |ort);...|SetPort |
|00004a20| 28 77 29 3b 0d 09 09 53 | 63 72 6f 6c 6c 54 65 78 |(w);...S|crollTex|
|00004a30| 74 20 28 64 6f 63 2c 20 | 6c 69 6e 65 4e 75 6d 20 |t (doc, |lineNum |
|00004a40| 2d 20 47 65 74 43 74 6c | 56 61 6c 75 65 20 28 44 |- GetCtl|Value (D|
|00004a50| 6f 63 53 63 72 6f 6c 6c | 20 28 64 6f 63 29 29 29 |ocScroll| (doc)))|
|00004a60| 3b 0d 09 09 53 65 74 50 | 6f 72 74 20 28 73 61 76 |;...SetP|ort (sav|
|00004a70| 65 50 6f 72 74 29 3b 0d | 09 7d 0d 7d 0d 0d 0d 2f |ePort);.|.}.}.../|
|00004a80| 2a 0d 20 2a 20 53 65 74 | 20 64 69 73 70 6c 61 79 |*. * Set| display|
|00004a90| 20 77 69 6e 64 6f 77 20 | 61 63 74 69 76 61 74 65 | window |activate|
|00004aa0| 20 6e 6f 74 69 66 69 63 | 61 74 69 6f 6e 20 70 72 | notific|ation pr|
|00004ab0| 6f 63 65 64 75 72 65 2e | 0d 20 2a 20 50 61 73 73 |ocedure.|. * Pass|
|00004ac0| 20 6e 69 6c 20 74 6f 20 | 64 69 73 61 62 6c 65 20 | nil to |disable |
|00004ad0| 69 74 2e 0d 20 2a 2f 0d | 0d 70 61 73 63 61 6c 20 |it.. */.|.pascal |
|00004ae0| 76 6f 69 64 0d 53 65 74 | 44 57 69 6e 64 6f 77 4e |void.Set|DWindowN|
|00004af0| 6f 74 69 66 79 20 28 57 | 69 6e 64 6f 77 50 74 72 |otify (W|indowPtr|
|00004b00| 20 77 2c 20 54 44 69 73 | 70 41 63 74 69 76 61 74 | w, TDis|pActivat|
|00004b10| 65 50 72 6f 63 50 74 72 | 20 70 29 0d 7b 0d 44 6f |eProcPtr| p).{.Do|
|00004b20| 63 48 61 6e 64 6c 65 09 | 64 6f 63 3b 0d 0d 09 69 |cHandle.|doc;...i|
|00004b30| 66 20 28 77 20 3d 3d 20 | 6e 69 6c 29 09 09 09 2f |f (w == |nil).../|
|00004b40| 2a 20 72 65 73 65 74 20 | 77 69 6e 64 6f 77 20 63 |* reset |window c|
|00004b50| 72 65 61 74 69 6f 6e 20 | 64 65 66 61 75 6c 74 20 |reation |default |
|00004b60| 2a 2f 0d 09 09 64 5f 61 | 63 74 69 76 61 74 65 20 |*/...d_a|ctivate |
|00004b70| 3d 20 70 3b 0d 09 65 6c | 73 65 20 69 66 20 28 28 |= p;..el|se if ((|
|00004b80| 64 6f 63 20 3d 20 57 69 | 6e 64 44 6f 63 48 61 6e |doc = Wi|ndDocHan|
|00004b90| 64 6c 65 20 28 77 29 29 | 20 21 3d 20 28 44 6f 63 |dle (w))| != (Doc|
|00004ba0| 48 61 6e 64 6c 65 29 20 | 6e 69 6c 29 0d 09 09 44 |Handle) |nil)...D|
|00004bb0| 6f 63 41 63 74 69 76 61 | 74 65 50 72 6f 63 20 28 |ocActiva|teProc (|
|00004bc0| 64 6f 63 29 20 3d 20 70 | 3b 0d 7d 0d 0d 0d 2f 2a |doc) = p|;.}.../*|
|00004bd0| 0d 20 2a 20 53 65 74 20 | 64 69 73 70 6c 61 79 20 |. * Set |display |
|00004be0| 77 69 6e 64 6f 77 20 61 | 75 74 6f 66 6c 75 73 68 |window a|utoflush|
|00004bf0| 20 63 68 61 72 61 63 74 | 65 72 69 73 74 69 63 73 | charact|eristics|
|00004c00| 0d 20 2a 2f 0d 0d 70 61 | 73 63 61 6c 20 76 6f 69 |. */..pa|scal voi|
|00004c10| 64 0d 53 65 74 44 57 69 | 6e 64 6f 77 46 6c 75 73 |d.SetDWi|ndowFlus|
|00004c20| 68 20 28 57 69 6e 64 6f | 77 50 74 72 20 77 2c 20 |h (Windo|wPtr w, |
|00004c30| 6c 6f 6e 67 20 6d 61 78 | 54 65 78 74 2c 20 6c 6f |long max|Text, lo|
|00004c40| 6e 67 20 66 6c 75 73 68 | 41 6d 74 29 0d 7b 0d 44 |ng flush|Amt).{.D|
|00004c50| 6f 63 48 61 6e 64 6c 65 | 09 64 6f 63 3b 0d 0d 09 |ocHandle|.doc;...|
|00004c60| 69 66 20 28 6d 61 78 54 | 65 78 74 20 3e 20 33 32 |if (maxT|ext > 32|
|00004c70| 37 36 37 4c 29 0d 09 09 | 6d 61 78 54 65 78 74 20 |767L)...|maxText |
|00004c80| 3d 20 33 32 37 36 37 4c | 3b 0d 09 69 66 20 28 6d |= 32767L|;..if (m|
|00004c90| 61 78 54 65 78 74 20 3c | 20 64 5f 6c 6f 4d 61 78 |axText <| d_loMax|
|00004ca0| 54 65 78 74 29 0d 09 09 | 6d 61 78 54 65 78 74 20 |Text)...|maxText |
|00004cb0| 3d 20 64 5f 6c 6f 4d 61 | 78 54 65 78 74 3b 0d 09 |= d_loMa|xText;..|
|00004cc0| 69 66 20 28 66 6c 75 73 | 68 41 6d 74 20 3c 20 64 |if (flus|hAmt < d|
|00004cd0| 5f 6c 6f 46 6c 75 73 68 | 41 6d 74 29 0d 09 09 66 |_loFlush|Amt)...f|
|00004ce0| 6c 75 73 68 41 6d 74 20 | 3d 20 64 5f 6c 6f 46 6c |lushAmt |= d_loFl|
|00004cf0| 75 73 68 41 6d 74 3b 0d | 0d 09 69 66 20 28 77 20 |ushAmt;.|..if (w |
|00004d00| 3d 3d 20 6e 69 6c 29 09 | 09 09 2f 2a 20 72 65 73 |== nil).|../* res|
|00004d10| 65 74 20 77 69 6e 64 6f | 77 20 63 72 65 61 74 69 |et windo|w creati|
|00004d20| 6f 6e 20 64 65 66 61 75 | 6c 74 73 20 2a 2f 0d 09 |on defau|lts */..|
|00004d30| 7b 0d 09 09 64 5f 6d 61 | 78 54 65 78 74 20 3d 20 |{...d_ma|xText = |
|00004d40| 6d 61 78 54 65 78 74 3b | 0d 09 09 64 5f 66 6c 75 |maxText;|...d_flu|
|00004d50| 73 68 41 6d 74 20 3d 20 | 66 6c 75 73 68 41 6d 74 |shAmt = |flushAmt|
|00004d60| 3b 0d 09 09 72 65 74 75 | 72 6e 3b 0d 09 7d 0d 0d |;...retu|rn;..}..|
|00004d70| 09 69 66 20 28 28 64 6f | 63 20 3d 20 57 69 6e 64 |.if ((do|c = Wind|
|00004d80| 44 6f 63 48 61 6e 64 6c | 65 20 28 77 29 29 20 21 |DocHandl|e (w)) !|
|00004d90| 3d 20 28 44 6f 63 48 61 | 6e 64 6c 65 29 20 6e 69 |= (DocHa|ndle) ni|
|00004da0| 6c 29 0d 09 7b 0d 09 09 | 44 6f 63 4d 61 78 54 65 |l)..{...|DocMaxTe|
|00004db0| 78 74 20 28 64 6f 63 29 | 20 3d 20 6d 61 78 54 65 |xt (doc)| = maxTe|
|00004dc0| 78 74 3b 0d 09 09 44 6f | 63 46 6c 75 73 68 41 6d |xt;...Do|cFlushAm|
|00004dd0| 74 20 28 64 6f 63 29 20 | 3d 20 66 6c 75 73 68 41 |t (doc) |= flushA|
|00004de0| 6d 74 3b 0d 09 7d 0d 7d | 0d 0d 0d 2f 2a 0d 20 2a |mt;..}.}|.../*. *|
|00004df0| 20 53 65 74 20 77 68 69 | 63 68 20 64 69 73 70 6c | Set whi|ch displ|
|00004e00| 61 79 20 77 69 6e 64 6f | 77 20 69 73 20 74 6f 20 |ay windo|w is to |
|00004e10| 62 65 20 75 73 65 64 20 | 66 6f 72 20 6f 75 74 70 |be used |for outp|
|00004e20| 75 74 2e 20 20 49 66 20 | 74 68 65 57 69 6e 64 0d |ut. If |theWind.|
|00004e30| 20 2a 20 69 73 20 6e 69 | 6c 2c 20 6f 75 74 70 75 | * is ni|l, outpu|
|00004e40| 74 20 69 73 20 74 75 72 | 6e 65 64 20 6f 66 66 2e |t is tur|ned off.|
|00004e50| 20 20 49 66 20 74 68 65 | 57 69 6e 64 20 69 73 20 | If the|Wind is |
|00004e60| 6e 6f 74 20 61 20 6c 65 | 67 61 6c 20 64 69 73 70 |not a le|gal disp|
|00004e70| 6c 61 79 0d 20 2a 20 77 | 69 6e 64 6f 77 2c 20 6e |lay. * w|indow, n|
|00004e80| 6f 74 68 69 6e 67 20 69 | 73 20 64 6f 6e 65 2e 0d |othing i|s done..|
|00004e90| 20 2a 2f 0d 0d 70 61 73 | 63 61 6c 20 76 6f 69 64 | */..pas|cal void|
|00004ea0| 0d 53 65 74 44 57 69 6e | 64 6f 77 20 28 57 69 6e |.SetDWin|dow (Win|
|00004eb0| 64 6f 77 50 74 72 20 77 | 29 0d 7b 0d 09 69 66 20 |dowPtr w|).{..if |
|00004ec0| 28 77 20 3d 3d 20 6e 69 | 6c 20 7c 7c 20 49 73 44 |(w == ni|l || IsD|
|00004ed0| 57 69 6e 64 6f 77 20 28 | 77 29 29 0d 09 7b 0d 09 |Window (|w))..{..|
|00004ee0| 09 63 75 72 44 69 73 70 | 57 69 6e 64 20 3d 20 77 |.curDisp|Wind = w|
|00004ef0| 3b 0d 09 7d 0d 7d 0d 0d | 0d 2f 2a 0d 20 2a 20 47 |;..}.}..|./*. * G|
|00004f00| 65 74 20 74 68 65 20 57 | 69 6e 64 6f 77 50 74 72 |et the W|indowPtr|
|00004f10| 20 6f 66 20 74 68 65 20 | 63 75 72 72 65 6e 74 20 | of the |current |
|00004f20| 6f 75 74 70 75 74 20 64 | 69 73 70 6c 61 79 20 77 |output d|isplay w|
|00004f30| 69 6e 64 6f 77 2e 20 20 | 49 66 0d 20 2a 20 6f 75 |indow. |If. * ou|
|00004f40| 74 70 75 74 20 69 73 20 | 74 75 72 6e 65 64 20 6f |tput is |turned o|
|00004f50| 66 66 2c 20 74 68 69 73 | 20 77 69 6c 6c 20 62 65 |ff, this| will be|
|00004f60| 20 6e 69 6c 2e 0d 20 2a | 2f 0d 0d 70 61 73 63 61 | nil.. *|/..pasca|
|00004f70| 6c 20 57 69 6e 64 6f 77 | 50 74 72 0d 47 65 74 44 |l Window|Ptr.GetD|
|00004f80| 57 69 6e 64 6f 77 20 28 | 76 6f 69 64 29 0d 7b 0d |Window (|void).{.|
|00004f90| 09 72 65 74 75 72 6e 20 | 28 63 75 72 44 69 73 70 |.return |(curDisp|
|00004fa0| 57 69 6e 64 29 3b 0d 7d | 0d 0d 0d 2f 2a 0d 20 2a |Wind);.}|.../*. *|
|00004fb0| 20 46 6c 75 73 68 20 74 | 65 78 74 20 66 72 6f 6d | Flush t|ext from|
|00004fc0| 20 74 68 65 20 77 69 6e | 64 6f 77 20 61 6e 64 20 | the win|dow and |
|00004fd0| 72 65 61 64 6a 75 73 74 | 20 74 68 65 20 64 69 73 |readjust| the dis|
|00004fe0| 70 6c 61 79 2e 0d 20 2a | 2f 0d 0d 70 61 73 63 61 |play.. *|/..pasca|
|00004ff0| 6c 20 76 6f 69 64 0d 46 | 6c 75 73 68 44 57 69 6e |l void.F|lushDWin|
|00005000| 64 6f 77 20 28 57 69 6e | 64 6f 77 50 74 72 20 77 |dow (Win|dowPtr w|
|00005010| 2c 20 6c 6f 6e 67 20 62 | 79 74 65 43 6f 75 6e 74 |, long b|yteCount|
|00005020| 29 0d 7b 0d 44 6f 63 48 | 61 6e 64 6c 65 09 64 6f |).{.DocH|andle.do|
|00005030| 63 3b 0d 54 45 48 61 6e | 64 6c 65 09 68 54 45 3b |c;.TEHan|dle.hTE;|
|00005040| 0d 0d 09 69 66 20 28 28 | 64 6f 63 20 3d 20 57 69 |...if ((|doc = Wi|
|00005050| 6e 64 44 6f 63 48 61 6e | 64 6c 65 20 28 77 29 29 |ndDocHan|dle (w))|
|00005060| 20 21 3d 20 28 44 6f 63 | 48 61 6e 64 6c 65 29 20 | != (Doc|Handle) |
|00005070| 6e 69 6c 29 0d 09 7b 0d | 09 09 68 54 45 20 3d 20 |nil)..{.|..hTE = |
|00005080| 44 6f 63 54 45 20 28 64 | 6f 63 29 3b 0d 09 09 54 |DocTE (d|oc);...T|
|00005090| 45 53 65 74 53 65 6c 65 | 63 74 20 28 30 4c 2c 20 |ESetSele|ct (0L, |
|000050a0| 62 79 74 65 43 6f 75 6e | 74 2c 20 68 54 45 29 3b |byteCoun|t, hTE);|
|000050b0| 09 2f 2a 20 73 65 6c 65 | 63 74 20 74 65 78 74 20 |./* sele|ct text |
|000050c0| 2a 2f 0d 09 09 54 45 44 | 65 6c 65 74 65 20 28 68 |*/...TED|elete (h|
|000050d0| 54 45 29 3b 09 09 09 09 | 09 09 2f 2a 20 63 6c 6f |TE);....|../* clo|
|000050e0| 62 62 65 72 20 69 74 20 | 2a 2f 0d 09 09 4f 76 65 |bber it |*/...Ove|
|000050f0| 72 68 61 75 6c 44 69 73 | 70 6c 61 79 20 28 64 6f |rhaulDis|play (do|
|00005100| 63 29 3b 0d 09 7d 0d 7d | 0d 0d 0d 2f 2a 0d 20 2a |c);..}.}|.../*. *|
|00005110| 20 43 72 65 61 74 65 20 | 61 6e 64 20 69 6e 69 74 | Create |and init|
|00005120| 69 61 6c 69 7a 65 20 61 | 20 64 69 73 70 6c 61 79 |ialize a| display|
|00005130| 20 77 69 6e 64 6f 77 20 | 61 6e 64 20 74 68 65 20 | window |and the |
|00005140| 61 73 73 6f 63 69 61 74 | 65 64 20 64 61 74 61 0d |associat|ed data.|
|00005150| 20 2a 20 73 74 72 75 63 | 74 75 72 65 73 2e 20 20 | * struc|tures. |
|00005160| 49 66 20 74 68 65 20 77 | 69 6e 64 6f 77 20 61 6e |If the w|indow an|
|00005170| 64 20 64 61 74 61 20 63 | 61 6e 6e 6f 74 20 62 65 |d data c|annot be|
|00005180| 20 61 6c 6c 6f 63 61 74 | 65 64 2c 20 64 65 73 74 | allocat|ed, dest|
|00005190| 72 6f 79 0d 20 2a 20 74 | 68 65 20 77 69 6e 64 6f |roy. * t|he windo|
|000051a0| 77 20 61 6e 64 20 72 65 | 74 75 72 6e 20 6e 69 6c |w and re|turn nil|
|000051b0| 2e 20 20 4f 74 68 65 72 | 77 69 73 65 20 72 65 74 |. Other|wise ret|
|000051c0| 75 72 6e 20 74 68 65 20 | 77 69 6e 64 6f 77 2e 0d |urn the |window..|
|000051d0| 20 2a 0d 20 2a 20 54 68 | 65 20 77 69 6e 64 6f 77 | *. * Th|e window|
|000051e0| 20 69 73 20 6d 61 64 65 | 20 74 68 65 20 63 75 72 | is made| the cur|
|000051f0| 72 65 6e 74 20 6f 75 74 | 70 75 74 20 77 69 6e 64 |rent out|put wind|
|00005200| 6f 77 2c 20 62 75 74 20 | 74 68 65 20 63 61 6c 6c |ow, but |the call|
|00005210| 65 72 20 73 68 6f 75 6c | 64 0d 20 2a 20 73 65 74 |er shoul|d. * set|
|00005220| 20 61 6e 64 20 72 65 73 | 74 6f 72 65 20 74 68 65 | and res|tore the|
|00005230| 20 70 6f 72 74 20 62 65 | 66 6f 72 65 20 61 6e 64 | port be|fore and|
|00005240| 20 61 66 74 65 72 20 63 | 61 6c 6c 69 6e 67 20 53 | after c|alling S|
|00005250| 65 74 75 70 44 6f 63 57 | 69 6e 64 28 29 2e 0d 20 |etupDocW|ind().. |
|00005260| 2a 2f 0d 20 0d 73 74 61 | 74 69 63 20 57 69 6e 64 |*/. .sta|tic Wind|
|00005270| 6f 77 50 74 72 0d 53 65 | 74 75 70 44 6f 63 57 69 |owPtr.Se|tupDocWi|
|00005280| 6e 64 20 28 57 69 6e 64 | 6f 77 50 74 72 20 77 29 |nd (Wind|owPtr w)|
|00005290| 0d 7b 0d 52 65 63 74 09 | 72 3b 0d 44 6f 63 48 61 |.{.Rect.|r;.DocHa|
|000052a0| 6e 64 6c 65 09 64 6f 63 | 3b 0d 53 6b 65 6c 57 69 |ndle.doc|;.SkelWi|
|000052b0| 6e 64 50 72 6f 70 48 61 | 6e 64 6c 65 09 70 72 6f |ndPropHa|ndle.pro|
|000052c0| 70 3b 0d 43 6f 6e 74 72 | 6f 6c 48 61 6e 64 6c 65 |p;.Contr|olHandle|
|000052d0| 09 73 63 72 6f 6c 6c 3b | 0d 54 45 48 61 6e 64 6c |.scroll;|.TEHandl|
|000052e0| 65 09 09 68 54 45 3b 0d | 0d 09 69 66 20 28 21 53 |e..hTE;.|..if (!S|
|000052f0| 6b 65 6c 57 69 6e 64 6f | 77 20 28 77 2c 09 2f 2a |kelWindo|w (w,./*|
|00005300| 20 74 68 65 20 77 69 6e | 64 6f 77 20 2a 2f 0d 09 | the win|dow */..|
|00005310| 09 09 09 4d 6f 75 73 65 | 2c 09 09 09 2f 2a 20 6d |...Mouse|,.../* m|
|00005320| 6f 75 73 65 20 63 6c 69 | 63 6b 20 68 61 6e 64 6c |ouse cli|ck handl|
|00005330| 65 72 20 2a 2f 0d 09 09 | 09 09 6e 69 6c 2c 09 09 |er */...|..nil,..|
|00005340| 09 2f 2a 20 6b 65 79 20 | 63 6c 69 63 6b 73 20 61 |./* key |clicks a|
|00005350| 72 65 20 69 67 6e 6f 72 | 65 64 20 2a 2f 0d 09 09 |re ignor|ed */...|
|00005360| 09 09 55 70 64 61 74 65 | 2c 09 09 09 2f 2a 20 77 |..Update|,.../* w|
|00005370| 69 6e 64 6f 77 20 75 70 | 64 61 74 69 6e 67 20 70 |indow up|dating p|
|00005380| 72 6f 63 65 64 75 72 65 | 20 2a 2f 0d 09 09 09 09 |rocedure| */.....|
|00005390| 41 63 74 69 76 61 74 65 | 2c 09 09 2f 2a 20 77 69 |Activate|,../* wi|
|000053a0| 6e 64 6f 77 20 61 63 74 | 69 76 61 74 65 2f 64 65 |ndow act|ivate/de|
|000053b0| 61 63 74 69 76 61 74 65 | 20 70 72 6f 63 65 64 75 |activate| procedu|
|000053c0| 72 65 20 2a 2f 0d 09 09 | 09 09 6e 69 6c 2c 09 09 |re */...|..nil,..|
|000053d0| 09 2f 2a 20 54 72 61 6e | 73 53 6b 65 6c 20 68 69 |./* Tran|sSkel hi|
|000053e0| 64 65 73 20 77 69 6e 64 | 6f 77 20 69 66 20 6e 6f |des wind|ow if no|
|000053f0| 20 63 6c 6f 73 65 20 70 | 72 6f 63 20 2a 2f 0d 09 | close p|roc */..|
|00005400| 09 09 09 09 09 09 09 2f | 2a 20 28 67 65 6e 65 72 |......./|* (gener|
|00005410| 61 74 65 73 20 64 65 61 | 63 74 69 76 61 74 65 20 |ates dea|ctivate |
|00005420| 65 76 65 6e 74 29 20 2a | 2f 0d 09 09 09 09 43 6c |event) *|/.....Cl|
|00005430| 6f 62 62 65 72 2c 09 09 | 2f 2a 20 77 69 6e 64 6f |obber,..|/* windo|
|00005440| 77 20 64 69 73 70 6f 73 | 61 6c 20 70 72 6f 63 65 |w dispos|al proce|
|00005450| 64 75 72 65 20 2a 2f 0d | 09 09 09 09 6e 69 6c 2c |dure */.|....nil,|
|00005460| 09 09 09 2f 2a 20 6e 6f | 20 69 64 6c 65 20 70 72 |.../* no| idle pr|
|00005470| 6f 63 20 2a 2f 0d 09 09 | 09 09 66 61 6c 73 65 29 |oc */...|..false)|
|00005480| 29 09 09 09 2f 2a 20 69 | 72 72 65 6c 65 76 61 6e |).../* i|rrelevan|
|00005490| 74 20 73 69 6e 63 65 20 | 6e 6f 20 69 64 6c 65 20 |t since |no idle |
|000054a0| 70 72 6f 63 20 2a 2f 0d | 09 7b 0d 09 09 44 69 73 |proc */.|.{...Dis|
|000054b0| 70 6f 73 65 57 69 6e 64 | 6f 77 20 28 77 29 3b 0d |poseWind|ow (w);.|
|000054c0| 09 09 72 65 74 75 72 6e | 20 28 6e 69 6c 29 3b 0d |..return| (nil);.|
|000054d0| 09 7d 0d 0d 09 2f 2a 0d | 09 20 2a 20 41 66 74 65 |.}.../*.|. * Afte|
|000054e0| 72 20 74 68 69 73 20 70 | 6f 69 6e 74 20 53 6b 65 |r this p|oint Ske|
|000054f0| 6c 52 6d 76 65 57 69 6e | 64 28 29 20 63 61 6e 20 |lRmveWin|d() can |
|00005500| 62 65 20 63 61 6c 6c 65 | 64 20 74 6f 20 72 65 6d |be calle|d to rem|
|00005510| 6f 76 65 20 74 68 65 20 | 77 69 6e 64 6f 77 0d 09 |ove the |window..|
|00005520| 20 2a 20 69 66 20 61 6e | 79 20 61 6c 6c 6f 63 61 | * if an|y alloca|
|00005530| 74 69 6f 6e 73 20 66 61 | 69 6c 2e 0d 09 20 2a 2f |tions fa|il... */|
|00005540| 0d 0d 09 2f 2a 0d 09 20 | 2a 20 47 65 74 20 6e 65 |.../*.. |* Get ne|
|00005550| 77 20 64 6f 63 75 6d 65 | 6e 74 20 72 65 63 6f 72 |w docume|nt recor|
|00005560| 64 2c 20 61 74 74 61 63 | 68 20 74 6f 20 77 69 6e |d, attac|h to win|
|00005570| 64 6f 77 20 70 72 6f 70 | 65 72 74 79 20 6c 69 73 |dow prop|erty lis|
|00005580| 74 2e 0d 09 20 2a 20 41 | 6c 73 6f 20 6d 61 6b 65 |t... * A|lso make|
|00005590| 20 64 6f 63 75 6d 65 6e | 74 20 72 65 63 6f 72 64 | documen|t record|
|000055a0| 20 70 6f 69 6e 74 20 74 | 6f 20 77 69 6e 64 6f 77 | point t|o window|
|000055b0| 2e 0d 09 20 2a 2f 0d 0d | 09 69 66 20 28 21 53 6b |... */..|.if (!Sk|
|000055c0| 65 6c 41 64 64 57 69 6e | 64 50 72 6f 70 20 28 77 |elAddWin|dProp (w|
|000055d0| 2c 20 73 6b 65 6c 57 50 | 72 6f 70 44 69 73 70 6c |, skelWP|ropDispl|
|000055e0| 61 79 57 69 6e 64 2c 20 | 28 6c 6f 6e 67 29 20 30 |ayWind, |(long) 0|
|000055f0| 4c 29 29 0d 09 7b 0d 09 | 09 53 6b 65 6c 52 6d 76 |L))..{..|.SkelRmv|
|00005600| 65 57 69 6e 64 20 28 77 | 29 3b 0d 09 09 72 65 74 |eWind (w|);...ret|
|00005610| 75 72 6e 20 28 6e 69 6c | 29 3b 0d 09 7d 0d 09 64 |urn (nil|);..}..d|
|00005620| 6f 63 20 3d 20 4e 65 77 | 20 28 44 6f 63 52 65 63 |oc = New| (DocRec|
|00005630| 6f 72 64 29 3b 0d 09 69 | 66 20 28 64 6f 63 20 3d |ord);..i|f (doc =|
|00005640| 3d 20 28 44 6f 63 48 61 | 6e 64 6c 65 29 20 6e 69 |= (DocHa|ndle) ni|
|00005650| 6c 29 0d 09 7b 0d 09 09 | 53 6b 65 6c 52 6d 76 65 |l)..{...|SkelRmve|
|00005660| 57 69 6e 64 20 28 77 29 | 3b 0d 09 09 72 65 74 75 |Wind (w)|;...retu|
|00005670| 72 6e 20 28 6e 69 6c 29 | 3b 0d 09 7d 0d 09 70 72 |rn (nil)|;..}..pr|
|00005680| 6f 70 20 3d 20 53 6b 65 | 6c 47 65 74 57 69 6e 64 |op = Ske|lGetWind|
|00005690| 50 72 6f 70 20 28 77 2c | 20 73 6b 65 6c 57 50 72 |Prop (w,| skelWPr|
|000056a0| 6f 70 44 69 73 70 6c 61 | 79 57 69 6e 64 29 3b 0d |opDispla|yWind);.|
|000056b0| 09 28 2a 2a 70 72 6f 70 | 29 2e 73 6b 65 6c 57 50 |.(**prop|).skelWP|
|000056c0| 72 6f 70 44 61 74 61 20 | 3d 20 28 6c 6f 6e 67 29 |ropData |= (long)|
|000056d0| 20 64 6f 63 3b 0d 09 44 | 6f 63 57 69 6e 64 20 28 | doc;..D|ocWind (|
|000056e0| 64 6f 63 29 20 3d 20 77 | 3b 0d 0d 09 2f 2a 0d 09 |doc) = w|;.../*..|
|000056f0| 20 2a 20 42 75 69 6c 64 | 20 74 68 65 20 73 63 72 | * Build| the scr|
|00005700| 6f 6c 6c 20 62 61 72 2e | 20 20 4d 61 6b 65 20 73 |oll bar.| Make s|
|00005710| 75 72 65 20 74 68 65 20 | 62 6f 72 64 65 72 73 20 |ure the |borders |
|00005720| 6f 76 65 72 6c 61 70 20 | 74 68 65 0d 09 20 2a 20 |overlap |the.. * |
|00005730| 77 69 6e 64 6f 77 20 66 | 72 61 6d 65 20 61 6e 64 |window f|rame and|
|00005740| 20 74 68 65 20 66 72 61 | 6d 65 20 6f 66 20 74 68 | the fra|me of th|
|00005750| 65 20 67 72 6f 77 20 62 | 6f 78 2e 0d 09 20 2a 2f |e grow b|ox... */|
|00005760| 0d 0d 09 43 61 6c 63 53 | 63 72 6f 6c 6c 52 65 63 |...CalcS|crollRec|
|00005770| 74 20 28 77 2c 20 26 72 | 29 3b 0d 09 73 63 72 6f |t (w, &r|);..scro|
|00005780| 6c 6c 20 3d 20 4e 65 77 | 43 6f 6e 74 72 6f 6c 20 |ll = New|Control |
|00005790| 28 77 2c 20 26 72 2c 20 | 22 5c 70 22 2c 20 74 72 |(w, &r, |"\p", tr|
|000057a0| 75 65 2c 20 30 2c 20 30 | 2c 20 30 2c 20 73 63 72 |ue, 0, 0|, 0, scr|
|000057b0| 6f 6c 6c 42 61 72 50 72 | 6f 63 2c 20 30 4c 29 3b |ollBarPr|oc, 0L);|
|000057c0| 0d 09 44 6f 63 53 63 72 | 6f 6c 6c 20 28 64 6f 63 |..DocScr|oll (doc|
|000057d0| 29 20 3d 20 73 63 72 6f | 6c 6c 3b 0d 0d 09 2f 2a |) = scro|ll;.../*|
|000057e0| 0d 09 20 2a 20 43 72 65 | 61 74 65 20 74 68 65 20 |.. * Cre|ate the |
|000057f0| 54 45 20 72 65 63 6f 72 | 64 20 75 73 65 64 20 66 |TE recor|d used f|
|00005800| 6f 72 20 74 65 78 74 20 | 64 69 73 70 6c 61 79 2e |or text |display.|
|00005810| 20 20 55 73 65 20 64 65 | 66 61 75 6c 74 73 20 66 | Use de|faults f|
|00005820| 6f 72 0d 09 20 2a 20 64 | 69 73 70 6c 61 79 20 63 |or.. * d|isplay c|
|00005830| 68 61 72 61 63 74 65 72 | 69 73 74 69 63 73 2e 20 |haracter|istics. |
|00005840| 20 53 65 74 74 69 6e 67 | 20 77 69 6e 64 6f 77 20 | Setting| window |
|00005850| 73 74 79 6c 65 20 6f 76 | 65 72 68 61 75 6c 73 0d |style ov|erhauls.|
|00005860| 09 20 2a 20 64 69 73 70 | 6c 61 79 2c 20 73 6f 20 |. * disp|lay, so |
|00005870| 63 61 6e 20 63 61 6e 63 | 65 6c 20 61 6e 79 20 75 |can canc|el any u|
|00005880| 70 64 61 74 65 20 65 76 | 65 6e 74 20 70 65 6e 64 |pdate ev|ent pend|
|00005890| 69 6e 67 20 66 6f 72 20 | 74 68 65 20 77 69 6e 64 |ing for |the wind|
|000058a0| 6f 77 2e 0d 09 20 2a 2f | 0d 0d 09 43 61 6c 63 45 |ow... */|...CalcE|
|000058b0| 64 69 74 52 65 63 74 20 | 28 77 2c 20 26 72 29 3b |ditRect |(w, &r);|
|000058c0| 0d 09 68 54 45 20 3d 20 | 54 45 4e 65 77 20 28 26 |..hTE = |TENew (&|
|000058d0| 72 2c 20 26 72 29 3b 0d | 09 44 6f 63 54 45 20 28 |r, &r);.|.DocTE (|
|000058e0| 64 6f 63 29 20 3d 20 68 | 54 45 3b 0d 0d 09 69 66 |doc) = h|TE;...if|
|000058f0| 20 28 73 63 72 6f 6c 6c | 20 3d 3d 20 28 43 6f 6e | (scroll| == (Con|
|00005900| 74 72 6f 6c 48 61 6e 64 | 6c 65 29 20 6e 69 6c 20 |trolHand|le) nil |
|00005910| 7c 7c 20 68 54 45 20 3d | 3d 20 28 54 45 48 61 6e ||| hTE =|= (TEHan|
|00005920| 64 6c 65 29 20 6e 69 6c | 29 0d 09 7b 0d 09 09 53 |dle) nil|)..{...S|
|00005930| 6b 65 6c 52 6d 76 65 57 | 69 6e 64 20 28 77 29 3b |kelRmveW|ind (w);|
|00005940| 0d 09 09 72 65 74 75 72 | 6e 20 28 6e 69 6c 29 3b |...retur|n (nil);|
|00005950| 0d 09 7d 0d 0d 09 53 65 | 74 44 57 69 6e 64 6f 77 |..}...Se|tDWindow|
|00005960| 4e 6f 74 69 66 79 20 28 | 77 2c 20 64 5f 61 63 74 |Notify (|w, d_act|
|00005970| 69 76 61 74 65 29 3b 0d | 09 53 65 74 44 57 69 6e |ivate);.|.SetDWin|
|00005980| 64 6f 77 46 6c 75 73 68 | 20 28 77 2c 20 64 5f 6d |dowFlush| (w, d_m|
|00005990| 61 78 54 65 78 74 2c 20 | 64 5f 66 6c 75 73 68 41 |axText, |d_flushA|
|000059a0| 6d 74 29 3b 0d 09 53 65 | 74 44 57 69 6e 64 6f 77 |mt);..Se|tDWindow|
|000059b0| 53 74 79 6c 65 20 28 77 | 2c 20 64 5f 66 6f 6e 74 |Style (w|, d_font|
|000059c0| 2c 20 64 5f 73 69 7a 65 | 2c 20 64 5f 77 72 61 70 |, d_size|, d_wrap|
|000059d0| 2c 20 64 5f 6a 75 73 74 | 29 3b 0d 0d 09 2f 2a 0d |, d_just|);.../*.|
|000059e0| 09 20 2a 20 4d 61 6b 65 | 20 77 69 6e 64 6f 77 20 |. * Make| window |
|000059f0| 63 75 72 72 65 6e 74 20 | 64 69 73 70 6c 61 79 20 |current |display |
|00005a00| 6f 75 74 70 75 74 20 77 | 69 6e 64 6f 77 0d 09 20 |output w|indow.. |
|00005a10| 2a 2f 0d 0d 09 53 65 74 | 44 57 69 6e 64 6f 77 20 |*/...Set|DWindow |
|00005a20| 28 77 29 3b 0d 09 72 65 | 74 75 72 6e 20 28 77 29 |(w);..re|turn (w)|
|00005a30| 3b 0d 7d 0d 0d 0d 2f 2a | 0d 20 2a 20 43 72 65 61 |;.}.../*|. * Crea|
|00005a40| 74 65 20 61 6e 64 20 69 | 6e 69 74 69 61 6c 69 7a |te and i|nitializ|
|00005a50| 65 20 61 20 64 69 73 70 | 6c 61 79 20 77 69 6e 64 |e a disp|lay wind|
|00005a60| 6f 77 20 61 6e 64 20 74 | 68 65 20 61 73 73 6f 63 |ow and t|he assoc|
|00005a70| 69 61 74 65 64 20 64 61 | 74 61 0d 20 2a 20 73 74 |iated da|ta. * st|
|00005a80| 72 75 63 74 75 72 65 73 | 2c 20 61 6e 64 20 72 65 |ructures|, and re|
|00005a90| 74 75 72 6e 20 74 68 65 | 20 77 69 6e 64 6f 77 20 |turn the| window |
|00005aa0| 70 6f 69 6e 74 65 72 2e | 0d 20 2a 0d 20 2a 20 54 |pointer.|. *. * T|
|00005ab0| 68 65 20 70 61 72 61 6d | 65 74 65 72 73 20 61 72 |he param|eters ar|
|00005ac0| 65 20 73 69 6d 69 6c 61 | 72 20 74 6f 20 74 68 6f |e simila|r to tho|
|00005ad0| 73 65 20 66 6f 72 20 4e | 65 77 57 69 6e 64 6f 77 |se for N|ewWindow|
|00005ae0| 2e 20 20 53 65 65 20 49 | 6e 73 69 64 65 0d 20 2a |. See I|nside. *|
|00005af0| 20 4d 61 63 69 6e 74 6f | 73 68 2e 0d 20 2a 0d 20 | Macinto|sh.. *. |
|00005b00| 2a 20 50 72 65 73 65 72 | 76 65 73 20 74 68 65 20 |* Preser|ves the |
|00005b10| 63 75 72 72 65 6e 74 20 | 70 6f 72 74 2e 20 20 49 |current |port. I|
|00005b20| 66 20 74 68 65 20 77 69 | 6e 64 6f 77 20 69 73 20 |f the wi|ndow is |
|00005b30| 76 69 73 69 62 6c 65 2c | 0d 20 2a 20 61 6e 20 61 |visible,|. * an a|
|00005b40| 63 74 69 76 61 74 65 20 | 65 76 65 6e 74 20 77 69 |ctivate |event wi|
|00005b50| 6c 6c 20 66 6f 6c 6c 6f | 77 2c 20 61 74 20 77 68 |ll follo|w, at wh|
|00005b60| 69 63 68 20 70 6f 69 6e | 74 20 74 68 65 20 70 6f |ich poin|t the po|
|00005b70| 72 74 0d 20 2a 20 77 69 | 6c 6c 20 62 65 20 73 65 |rt. * wi|ll be se|
|00005b80| 74 20 74 6f 20 74 68 65 | 20 77 69 6e 64 6f 77 2e |t to the| window.|
|00005b90| 0d 20 2a 2f 0d 20 0d 70 | 61 73 63 61 6c 20 57 69 |. */. .p|ascal Wi|
|00005ba0| 6e 64 6f 77 50 74 72 0d | 4e 65 77 44 57 69 6e 64 |ndowPtr.|NewDWind|
|00005bb0| 6f 77 20 28 52 65 63 74 | 20 2a 62 6f 75 6e 64 73 |ow (Rect| *bounds|
|00005bc0| 2c 20 53 74 72 69 6e 67 | 50 74 72 20 74 69 74 6c |, String|Ptr titl|
|00005bd0| 65 2c 20 42 6f 6f 6c 65 | 61 6e 20 76 69 73 69 62 |e, Boole|an visib|
|00005be0| 6c 65 2c 0d 09 09 09 09 | 09 57 69 6e 64 6f 77 50 |le,.....|.WindowP|
|00005bf0| 74 72 20 62 65 68 69 6e | 64 2c 20 42 6f 6f 6c 65 |tr behin|d, Boole|
|00005c00| 61 6e 20 67 6f 41 77 61 | 79 2c 20 6c 6f 6e 67 20 |an goAwa|y, long |
|00005c10| 72 65 66 43 6f 6e 29 0d | 7b 0d 57 69 6e 64 6f 77 |refCon).|{.Window|
|00005c20| 50 74 72 09 77 3b 0d 47 | 72 61 66 50 74 72 09 09 |Ptr.w;.G|rafPtr..|
|00005c30| 73 61 76 65 50 6f 72 74 | 3b 0d 0d 09 69 66 20 28 |savePort|;...if (|
|00005c40| 53 6b 65 6c 51 75 65 72 | 79 20 28 73 6b 65 6c 51 |SkelQuer|y (skelQ|
|00005c50| 48 61 73 43 6f 6c 6f 72 | 51 44 29 29 0d 09 7b 0d |HasColor|QD))..{.|
|00005c60| 09 09 77 20 3d 20 4e 65 | 77 43 57 69 6e 64 6f 77 |..w = Ne|wCWindow|
|00005c70| 20 28 6e 69 6c 2c 0d 09 | 09 09 09 09 09 20 20 20 | (nil,..|..... |
|00005c80| 62 6f 75 6e 64 73 2c 0d | 09 09 09 09 09 09 20 20 |bounds,.|...... |
|00005c90| 20 74 69 74 6c 65 2c 0d | 09 09 09 09 09 09 20 20 | title,.|...... |
|00005ca0| 20 76 69 73 69 62 6c 65 | 2c 0d 09 09 09 09 09 09 | visible|,.......|
|00005cb0| 20 20 20 64 6f 63 75 6d | 65 6e 74 50 72 6f 63 20 | docum|entProc |
|00005cc0| 2b 20 38 2c 0d 09 09 09 | 09 09 09 20 20 20 62 65 |+ 8,....|... be|
|00005cd0| 68 69 6e 64 2c 0d 09 09 | 09 09 09 09 20 20 20 67 |hind,...|.... g|
|00005ce0| 6f 41 77 61 79 2c 0d 09 | 09 09 09 09 09 20 20 20 |oAway,..|..... |
|00005cf0| 72 65 66 43 6f 6e 29 3b | 0d 09 7d 0d 09 65 6c 73 |refCon);|..}..els|
|00005d00| 65 0d 09 7b 0d 09 09 77 | 20 3d 20 4e 65 77 57 69 |e..{...w| = NewWi|
|00005d10| 6e 64 6f 77 20 28 6e 69 | 6c 2c 0d 09 09 09 09 09 |ndow (ni|l,......|
|00005d20| 09 20 20 20 62 6f 75 6e | 64 73 2c 0d 09 09 09 09 |. boun|ds,.....|
|00005d30| 09 09 20 20 20 74 69 74 | 6c 65 2c 0d 09 09 09 09 |.. tit|le,.....|
|00005d40| 09 09 20 20 20 76 69 73 | 69 62 6c 65 2c 0d 09 09 |.. vis|ible,...|
|00005d50| 09 09 09 09 20 20 20 64 | 6f 63 75 6d 65 6e 74 50 |.... d|ocumentP|
|00005d60| 72 6f 63 20 2b 20 38 2c | 0d 09 09 09 09 09 09 20 |roc + 8,|....... |
|00005d70| 20 20 62 65 68 69 6e 64 | 2c 0d 09 09 09 09 09 09 | behind|,.......|
|00005d80| 20 20 20 67 6f 41 77 61 | 79 2c 0d 09 09 09 09 09 | goAwa|y,......|
|00005d90| 09 20 20 20 72 65 66 43 | 6f 6e 29 3b 0d 09 7d 0d |. refC|on);..}.|
|00005da0| 0d 09 69 66 20 28 77 20 | 21 3d 20 28 57 69 6e 64 |..if (w |!= (Wind|
|00005db0| 6f 77 50 74 72 29 20 6e | 69 6c 29 0d 09 7b 0d 09 |owPtr) n|il)..{..|
|00005dc0| 09 47 65 74 50 6f 72 74 | 20 28 26 73 61 76 65 50 |.GetPort| (&saveP|
|00005dd0| 6f 72 74 29 3b 0d 09 09 | 77 20 3d 20 53 65 74 75 |ort);...|w = Setu|
|00005de0| 70 44 6f 63 57 69 6e 64 | 20 28 77 29 3b 09 09 2f |pDocWind| (w);../|
|00005df0| 2a 20 6e 69 6c 20 69 66 | 20 61 6c 6c 6f 63 61 74 |* nil if| allocat|
|00005e00| 69 6f 6e 20 66 61 69 6c | 65 64 20 2a 2f 0d 09 09 |ion fail|ed */...|
|00005e10| 53 65 74 50 6f 72 74 20 | 28 73 61 76 65 50 6f 72 |SetPort |(savePor|
|00005e20| 74 29 3b 0d 09 7d 0d 09 | 72 65 74 75 72 6e 20 28 |t);..}..|return (|
|00005e30| 77 29 3b 0d 7d 0d 0d 0d | 2f 2a 0d 20 2a 20 43 72 |w);.}...|/*. * Cr|
|00005e40| 65 61 74 65 20 61 6e 64 | 20 69 6e 69 74 69 61 6c |eate and| initial|
|00005e50| 69 7a 65 20 61 20 64 69 | 73 70 6c 61 79 20 77 69 |ize a di|splay wi|
|00005e60| 6e 64 6f 77 20 28 75 73 | 69 6e 67 20 61 20 72 65 |ndow (us|ing a re|
|00005e70| 73 6f 75 72 63 65 29 20 | 61 6e 64 0d 20 2a 20 74 |source) |and. * t|
|00005e80| 68 65 20 61 73 73 6f 63 | 69 61 74 65 64 20 64 61 |he assoc|iated da|
|00005e90| 74 61 20 73 74 72 75 63 | 74 75 72 65 73 2c 20 61 |ta struc|tures, a|
|00005ea0| 6e 64 20 72 65 74 75 72 | 6e 20 74 68 65 20 77 69 |nd retur|n the wi|
|00005eb0| 6e 64 6f 77 20 70 6f 69 | 6e 74 65 72 2e 0d 20 2a |ndow poi|nter.. *|
|00005ec0| 20 49 6e 73 74 61 6c 6c | 20 77 69 6e 64 6f 77 20 | Install| window |
|00005ed0| 69 6e 20 6c 69 73 74 20 | 6f 66 20 64 69 73 70 6c |in list |of displ|
|00005ee0| 61 79 20 77 69 6e 64 6f | 77 73 2e 20 20 49 6e 20 |ay windo|ws. In |
|00005ef0| 73 69 6e 67 6c 65 2d 77 | 69 6e 64 6f 77 0d 20 2a |single-w|indow. *|
|00005f00| 20 6d 6f 64 65 2c 20 64 | 69 73 61 6c 6c 6f 77 20 | mode, d|isallow |
|00005f10| 63 72 65 61 74 69 6f 6e | 20 6f 66 20 61 20 6e 65 |creation| of a ne|
|00005f20| 77 20 77 69 6e 64 6f 77 | 20 69 66 20 6f 6e 65 20 |w window| if one |
|00005f30| 61 6c 72 65 61 64 79 20 | 65 78 69 73 74 73 2e 0d |already |exists..|
|00005f40| 20 2a 0d 20 2a 20 54 68 | 65 20 70 61 72 61 6d 65 | *. * Th|e parame|
|00005f50| 74 65 72 73 20 61 72 65 | 20 73 69 6d 69 6c 61 72 |ters are| similar|
|00005f60| 20 74 6f 20 74 68 6f 73 | 65 20 66 6f 72 20 47 65 | to thos|e for Ge|
|00005f70| 74 4e 65 77 57 69 6e 64 | 6f 77 2e 20 20 53 65 65 |tNewWind|ow. See|
|00005f80| 20 49 6e 73 69 64 65 0d | 20 2a 20 4d 61 63 69 6e | Inside.| * Macin|
|00005f90| 74 6f 73 68 2e 0d 20 2a | 2f 0d 20 0d 70 61 73 63 |tosh.. *|/. .pasc|
|00005fa0| 61 6c 20 57 69 6e 64 6f | 77 50 74 72 0d 47 65 74 |al Windo|wPtr.Get|
|00005fb0| 4e 65 77 44 57 69 6e 64 | 6f 77 20 28 73 68 6f 72 |NewDWind|ow (shor|
|00005fc0| 74 20 72 65 73 6f 75 72 | 63 65 4e 75 6d 2c 20 57 |t resour|ceNum, W|
|00005fd0| 69 6e 64 6f 77 50 74 72 | 20 62 65 68 69 6e 64 29 |indowPtr| behind)|
|00005fe0| 0d 7b 0d 57 69 6e 64 6f | 77 50 74 72 09 77 3b 0d |.{.Windo|wPtr.w;.|
|00005ff0| 47 72 61 66 50 74 72 09 | 09 73 61 76 65 50 6f 72 |GrafPtr.|.savePor|
|00006000| 74 3b 0d 0d 09 69 66 20 | 28 53 6b 65 6c 51 75 65 |t;...if |(SkelQue|
|00006010| 72 79 20 28 73 6b 65 6c | 51 48 61 73 43 6f 6c 6f |ry (skel|QHasColo|
|00006020| 72 51 44 29 29 0d 09 09 | 77 20 3d 20 47 65 74 4e |rQD))...|w = GetN|
|00006030| 65 77 43 57 69 6e 64 6f | 77 20 28 72 65 73 6f 75 |ewCWindo|w (resou|
|00006040| 72 63 65 4e 75 6d 2c 20 | 6e 69 6c 2c 20 62 65 68 |rceNum, |nil, beh|
|00006050| 69 6e 64 29 3b 0d 09 65 | 6c 73 65 0d 09 09 77 20 |ind);..e|lse...w |
|00006060| 3d 20 47 65 74 4e 65 77 | 57 69 6e 64 6f 77 20 28 |= GetNew|Window (|
|00006070| 72 65 73 6f 75 72 63 65 | 4e 75 6d 2c 20 6e 69 6c |resource|Num, nil|
|00006080| 2c 20 62 65 68 69 6e 64 | 29 3b 0d 0d 09 69 66 20 |, behind|);...if |
|00006090| 28 77 20 21 3d 20 28 57 | 69 6e 64 6f 77 50 74 72 |(w != (W|indowPtr|
|000060a0| 29 20 6e 69 6c 29 0d 09 | 7b 0d 09 09 47 65 74 50 |) nil)..|{...GetP|
|000060b0| 6f 72 74 20 28 26 73 61 | 76 65 50 6f 72 74 29 3b |ort (&sa|vePort);|
|000060c0| 0d 09 09 77 20 3d 20 53 | 65 74 75 70 44 6f 63 57 |...w = S|etupDocW|
|000060d0| 69 6e 64 20 28 77 29 3b | 09 09 2f 2a 20 6e 69 6c |ind (w);|../* nil|
|000060e0| 20 69 66 20 61 6c 6c 6f | 63 61 74 69 6f 6e 20 66 | if allo|cation f|
|000060f0| 61 69 6c 65 64 20 2a 2f | 0d 09 09 53 65 74 50 6f |ailed */|...SetPo|
|00006100| 72 74 20 28 73 61 76 65 | 50 6f 72 74 29 3b 0d 09 |rt (save|Port);..|
|00006110| 7d 0d 09 72 65 74 75 72 | 6e 20 28 77 29 3b 0d 7d |}..retur|n (w);.}|
|00006120| 0d 0d 0d 2f 2a 20 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |.../* --|--------|
|00006130| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00006140| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00006150| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00006160| 2d 2d 20 2a 2f 0d 2f 2a | 09 09 09 09 09 09 4f 75 |-- */./*|......Ou|
|00006170| 74 70 75 74 20 52 6f 75 | 74 69 6e 65 73 09 09 09 |tput Rou|tines...|
|00006180| 09 09 09 09 2a 2f 0d 2f | 2a 20 2d 2d 2d 2d 2d 2d |....*/./|* ------|
|00006190| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000061a0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000061b0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000061c0| 2d 2d 2d 2d 2d 2d 20 2a | 2f 0d 0d 0d 2f 2a 0d 20 |------ *|/.../*. |
|000061d0| 2a 20 57 72 69 74 65 20 | 74 65 78 74 20 74 6f 20 |* Write |text to |
|000061e0| 64 69 73 70 6c 61 79 20 | 61 72 65 61 20 69 66 20 |display |area if |
|000061f0| 6f 75 74 70 75 74 20 69 | 73 20 6f 6e 20 28 63 75 |output i|s on (cu|
|00006200| 72 44 69 73 70 57 69 6e | 64 20 21 3d 20 6e 69 6c |rDispWin|d != nil|
|00006210| 29 2e 0d 20 2a 20 44 69 | 73 70 6c 61 79 54 65 78 |).. * Di|splayTex|
|00006220| 74 20 69 73 20 74 68 65 | 20 66 75 6e 64 61 6d 65 |t is the| fundame|
|00006230| 6e 74 61 6c 20 6f 75 74 | 70 75 74 20 72 6f 75 74 |ntal out|put rout|
|00006240| 69 6e 65 2e 20 20 41 6c | 6c 20 6f 74 68 65 72 0d |ine. Al|l other.|
|00006250| 20 2a 20 6f 75 74 70 75 | 74 20 63 61 6c 6c 73 20 | * outpu|t calls |
|00006260| 6d 61 70 20 28 65 76 65 | 6e 74 75 61 6c 6c 79 29 |map (eve|ntually)|
|00006270| 20 74 6f 20 69 74 2e 0d | 20 2a 0d 20 2a 20 46 69 | to it..| *. * Fi|
|00006280| 72 73 74 20 63 68 65 63 | 6b 20 77 68 65 74 68 65 |rst chec|k whethe|
|00006290| 72 20 74 68 65 20 69 6e | 73 65 72 74 69 6f 6e 20 |r the in|sertion |
|000062a0| 77 69 6c 6c 20 63 61 75 | 73 65 20 6f 76 65 72 66 |will cau|se overf|
|000062b0| 6c 6f 77 20 61 6e 64 20 | 66 6c 75 73 68 0d 20 2a |low and |flush. *|
|000062c0| 20 6f 75 74 20 73 6f 6d | 65 20 73 74 75 66 66 20 | out som|e stuff |
|000062d0| 69 66 20 73 6f 2e 20 20 | 49 6e 73 65 72 74 20 6e |if so. |Insert n|
|000062e0| 65 77 20 74 65 78 74 20 | 61 74 20 74 68 65 20 65 |ew text |at the e|
|000062f0| 6e 64 2c 20 74 68 65 6e | 20 74 65 73 74 0d 20 2a |nd, then| test. *|
|00006300| 20 77 68 65 74 68 65 72 | 20 6c 69 6e 65 73 20 6d | whether| lines m|
|00006310| 75 73 74 20 62 65 20 73 | 63 72 6f 6c 6c 65 64 20 |ust be s|crolled |
|00006320| 74 6f 20 67 65 74 20 74 | 68 65 20 6e 65 77 20 73 |to get t|he new s|
|00006330| 74 75 66 66 20 74 6f 20 | 73 68 6f 77 20 75 70 2e |tuff to |show up.|
|00006340| 0d 20 2a 20 49 66 20 79 | 65 73 2c 20 74 68 65 6e |. * If y|es, then|
|00006350| 20 64 6f 20 74 68 65 20 | 73 63 72 6f 6c 6c 2e 20 | do the |scroll. |
|00006360| 20 53 65 74 20 76 61 6c | 75 65 73 20 6f 66 20 73 | Set val|ues of s|
|00006370| 63 72 6f 6c 6c 20 62 61 | 72 20 70 72 6f 70 65 72 |croll ba|r proper|
|00006380| 6c 79 0d 20 2a 20 61 6e | 64 20 68 69 67 68 6c 69 |ly. * an|d highli|
|00006390| 67 68 74 20 61 73 20 61 | 70 70 72 6f 70 72 69 61 |ght as a|ppropria|
|000063a0| 74 65 2e 0d 20 2a 0d 20 | 2a 20 54 68 65 20 63 75 |te.. *. |* The cu|
|000063b0| 72 72 65 6e 74 20 70 6f | 72 74 20 69 73 20 70 72 |rrent po|rt is pr|
|000063c0| 65 73 65 72 76 65 64 2e | 20 20 53 69 6e 63 65 20 |eserved.| Since |
|000063d0| 61 6c 6c 20 6f 75 74 70 | 75 74 20 63 61 6c 6c 73 |all outp|ut calls|
|000063e0| 20 65 6e 64 20 75 70 0d | 20 2a 20 68 65 72 65 2c | end up.| * here,|
|000063f0| 20 69 74 27 73 20 74 68 | 65 20 6f 6e 6c 79 20 6f | it's th|e only o|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.